fix clippy
This commit is contained in:
parent
0c86a97ab4
commit
0e9a7c067c
1 changed files with 3 additions and 7 deletions
|
@ -1173,7 +1173,7 @@ fn window_show_resize<T: Clone + 'static>(config: &Config, ui: &Rc<UiElements<T>
|
||||||
let target_height = if let Some(lines) = config.lines() {
|
let target_height = if let Some(lines) = config.lines() {
|
||||||
Some(calculate_row_height(ui, lines, config))
|
Some(calculate_row_height(ui, lines, config))
|
||||||
} else if config.dynamic_lines() {
|
} else if config.dynamic_lines() {
|
||||||
Some(calculate_dynamic_lines_window_height(&config, ui, geometry))
|
Some(calculate_dynamic_lines_window_height(config, ui, geometry))
|
||||||
} else if let Some(height) = percent_or_absolute(&config.height(), geometry.height()) {
|
} else if let Some(height) = percent_or_absolute(&config.height(), geometry.height()) {
|
||||||
Some(height)
|
Some(height)
|
||||||
} else {
|
} else {
|
||||||
|
@ -1205,14 +1205,10 @@ fn calculate_dynamic_lines_window_height<T: Clone + 'static>(
|
||||||
|
|
||||||
fn get_monitor_geometry<T: Clone>(ui: &UiElements<T>) -> Option<Rectangle> {
|
fn get_monitor_geometry<T: Clone>(ui: &UiElements<T>) -> Option<Rectangle> {
|
||||||
// Get the surface and associated monitor geometry
|
// Get the surface and associated monitor geometry
|
||||||
let Some(surface) = ui.window.surface() else {
|
let surface = ui.window.surface()?;
|
||||||
return None;
|
|
||||||
};
|
|
||||||
|
|
||||||
let display = surface.display();
|
let display = surface.display();
|
||||||
let Some(monitor) = display.monitor_at_surface(&surface) else {
|
let monitor = display.monitor_at_surface(&surface)?;
|
||||||
return None;
|
|
||||||
};
|
|
||||||
let geometry = monitor.geometry();
|
let geometry = monitor.geometry();
|
||||||
Some(geometry)
|
Some(geometry)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue