From 217b63f10620ca532876f7db0ce25e60e5a1c98b Mon Sep 17 00:00:00 2001 From: Poly Date: Fri, 30 Jul 2021 18:03:19 +0200 Subject: [PATCH] Fix Clippy for Anvil --- anvil/src/drawing.rs | 9 ++++----- anvil/src/shell.rs | 2 +- anvil/src/udev.rs | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/anvil/src/drawing.rs b/anvil/src/drawing.rs index dc33336..4d386c7 100644 --- a/anvil/src/drawing.rs +++ b/anvil/src/drawing.rs @@ -157,7 +157,7 @@ where }, |_surface, states, location| { let mut location = *location; - if let Some(ref data) = states.data_map.get::>() { + if let Some(data) = states.data_map.get::>() { let mut data = data.borrow_mut(); let buffer_scale = data.buffer_scale; if let Some(texture) = data @@ -215,8 +215,7 @@ where initial_place.x -= output_rect.loc.x; if let Some(wl_surface) = toplevel_surface.get_surface() { // this surface is a root of a subsurface tree that needs to be drawn - if let Err(err) = - draw_surface_tree(renderer, frame, &wl_surface, initial_place, output_scale, log) + if let Err(err) = draw_surface_tree(renderer, frame, wl_surface, initial_place, output_scale, log) { result = Err(err); } @@ -225,12 +224,12 @@ where .geometry(toplevel_surface) .map(|g| g.loc) .unwrap_or_default(); - window_map.with_child_popups(&wl_surface, |popup| { + window_map.with_child_popups(wl_surface, |popup| { let location = popup.location(); let draw_location = initial_place + location + toplevel_geometry_offset; if let Some(wl_surface) = popup.get_surface() { if let Err(err) = - draw_surface_tree(renderer, frame, &wl_surface, draw_location, output_scale, log) + draw_surface_tree(renderer, frame, wl_surface, draw_location, output_scale, log) { result = Err(err); } diff --git a/anvil/src/shell.rs b/anvil/src/shell.rs index 7191e9f..7509ccb 100644 --- a/anvil/src/shell.rs +++ b/anvil/src/shell.rs @@ -301,7 +301,7 @@ fn fullscreen_output_geometry( // First test if a specific output has been requested // if the requested output is not found ignore the request if let Some(wl_output) = wl_output { - return output_map.find_by_output(&wl_output).map(|o| o.geometry()); + return output_map.find_by_output(wl_output).map(|o| o.geometry()); } // There is no output preference, try to find the output diff --git a/anvil/src/udev.rs b/anvil/src/udev.rs index 253f955..30d2533 100644 --- a/anvil/src/udev.rs +++ b/anvil/src/udev.rs @@ -630,7 +630,7 @@ impl AnvilState { let mut surfaces_iter = surfaces.iter(); let mut option_iter = crtc .iter() - .flat_map(|crtc| surfaces.get(&crtc).map(|surface| (crtc, surface))); + .flat_map(|crtc| surfaces.get(crtc).map(|surface| (crtc, surface))); let to_render_iter: &mut dyn Iterator>)> = if crtc.is_some() {