Fix Clippy for Anvil

This commit is contained in:
Poly 2021-07-30 18:03:19 +02:00 committed by Victor Berger
parent df9be985ca
commit 217b63f106
3 changed files with 6 additions and 7 deletions

View File

@ -157,7 +157,7 @@ where
},
|_surface, states, location| {
let mut location = *location;
if let Some(ref data) = states.data_map.get::<RefCell<SurfaceData>>() {
if let Some(data) = states.data_map.get::<RefCell<SurfaceData>>() {
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);
}

View File

@ -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

View File

@ -630,7 +630,7 @@ impl AnvilState<UdevData> {
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<Item = (&crtc::Handle, &Rc<RefCell<SurfaceData>>)> =
if crtc.is_some() {