diff --git a/src/backend/drm/device/atomic.rs b/src/backend/drm/device/atomic.rs index 12bc495..24ab6bb 100644 --- a/src/backend/drm/device/atomic.rs +++ b/src/backend/drm/device/atomic.rs @@ -195,7 +195,7 @@ impl AtomicDrmDevice { let prop = self .prop_mapping .0 - .get(&conn) + .get(conn) .expect("Unknown handle") .get("CRTC_ID") .expect("Unknown property CRTC_ID"); @@ -206,7 +206,7 @@ impl AtomicDrmDevice { let prop = self .prop_mapping .3 - .get(&plane) + .get(plane) .expect("Unknown handle") .get("CRTC_ID") .expect("Unknown property CRTC_ID"); @@ -215,7 +215,7 @@ impl AtomicDrmDevice { let prop = self .prop_mapping .3 - .get(&plane) + .get(plane) .expect("Unknown handle") .get("FB_ID") .expect("Unknown property FB_ID"); @@ -227,14 +227,14 @@ impl AtomicDrmDevice { let mode_prop = self .prop_mapping .1 - .get(&crtc) + .get(crtc) .expect("Unknown handle") .get("MODE_ID") .expect("Unknown property MODE_ID"); let active_prop = self .prop_mapping .1 - .get(&crtc) + .get(crtc) .expect("Unknown handle") .get("ACTIVE") .expect("Unknown property ACTIVE"); diff --git a/src/backend/drm/surface/atomic.rs b/src/backend/drm/surface/atomic.rs index 6221ed5..c0f64e9 100644 --- a/src/backend/drm/surface/atomic.rs +++ b/src/backend/drm/surface/atomic.rs @@ -66,7 +66,7 @@ impl State { for conn in res_handles.connectors() { let crtc_prop = prop_mapping .0 - .get(&conn) + .get(conn) .expect("Unknown handle") .get("CRTC_ID") .ok_or_else(|| Error::UnknownProperty { @@ -1006,7 +1006,7 @@ impl Drop for AtomicDrmSurface { let prop = self .prop_mapping .0 - .get(&conn) + .get(conn) .expect("Unknown Handle") .get("CRTC_ID") .expect("Unknown property CRTC_ID"); diff --git a/src/backend/libinput/tablet.rs b/src/backend/libinput/tablet.rs index 463555d..666a540 100644 --- a/src/backend/libinput/tablet.rs +++ b/src/backend/libinput/tablet.rs @@ -175,14 +175,14 @@ where impl backend::TabletToolButtonEvent for tablet_tool::TabletToolButtonEvent { fn button(&self) -> u32 { - tablet_tool::TabletToolButtonEvent::button(&self) + tablet_tool::TabletToolButtonEvent::button(self) } fn seat_button_count(&self) -> u32 { - tablet_tool::TabletToolButtonEvent::seat_button_count(&self) + tablet_tool::TabletToolButtonEvent::seat_button_count(self) } fn button_state(&self) -> backend::ButtonState { - tablet_tool::TabletToolButtonEvent::button_state(&self).into() + tablet_tool::TabletToolButtonEvent::button_state(self).into() } } diff --git a/src/backend/renderer/gles2/mod.rs b/src/backend/renderer/gles2/mod.rs index 66af65d..5be1a90 100644 --- a/src/backend/renderer/gles2/mod.rs +++ b/src/backend/renderer/gles2/mod.rs @@ -385,7 +385,7 @@ unsafe fn link_program( } unsafe fn texture_program(gl: &ffi::Gles2, frag: &'static str) -> Result { - let program = link_program(&gl, shaders::VERTEX_SHADER, frag)?; + let program = link_program(gl, shaders::VERTEX_SHADER, frag)?; let position = CStr::from_bytes_with_nul(b"position\0").expect("NULL terminated"); let tex_coords = CStr::from_bytes_with_nul(b"tex_coords\0").expect("NULL terminated"); @@ -557,7 +557,7 @@ impl ImportShm for Gles2Renderer { ) -> Result { use crate::wayland::shm::with_buffer_contents; - with_buffer_contents(&buffer, |slice, data| { + with_buffer_contents(buffer, |slice, data| { self.make_current()?; let offset = data.offset as i32; @@ -711,7 +711,7 @@ impl ImportEgl for Gles2Renderer { .egl_reader .as_ref() .unwrap() - .egl_buffer_contents(&buffer) + .egl_buffer_contents(buffer) .map_err(Gles2Error::EGLBufferAccessError)?; let tex = self.import_egl_image(egl.image(0).unwrap(), egl.format == EGLFormat::External, None)?; @@ -743,14 +743,14 @@ impl ImportDma for Gles2Renderer { return Err(Gles2Error::GLExtensionNotSupported(&["GL_OES_EGL_image"])); } - self.existing_dmabuf_texture(&buffer)?.map(Ok).unwrap_or_else(|| { + self.existing_dmabuf_texture(buffer)?.map(Ok).unwrap_or_else(|| { let is_external = !self.egl.dmabuf_render_formats().contains(&buffer.format()); self.make_current()?; let image = self .egl .display - .create_image_from_dmabuf(&buffer) + .create_image_from_dmabuf(buffer) .map_err(Gles2Error::BindBufferEGLError)?; let tex = self.import_egl_image(image, is_external, None)?; diff --git a/src/backend/renderer/mod.rs b/src/backend/renderer/mod.rs index 6e6af7f..f664d84 100644 --- a/src/backend/renderer/mod.rs +++ b/src/backend/renderer/mod.rs @@ -510,13 +510,13 @@ pub fn buffer_type(buffer: &wl_buffer::WlBuffer) -> Option { .unwrap() .as_ref() .and_then(|x| x.upgrade()) - .and_then(|x| x.egl_buffer_dimensions(&buffer)) + .and_then(|x| x.egl_buffer_dimensions(buffer)) .is_some() { return Some(BufferType::Egl); } - if crate::wayland::shm::with_buffer_contents(&buffer, |_, _| ()).is_ok() { + if crate::wayland::shm::with_buffer_contents(buffer, |_, _| ()).is_ok() { return Some(BufferType::Shm); } @@ -540,10 +540,10 @@ pub fn buffer_dimensions(buffer: &wl_buffer::WlBuffer) -> Option() .unwrap(); if surface.as_ref().is_alive() { - PrivateSurfaceData::unset_parent(&surface); + PrivateSurfaceData::unset_parent(surface); } } diff --git a/src/wayland/data_device/dnd_grab.rs b/src/wayland/data_device/dnd_grab.rs index 59a3876..d8e02be 100644 --- a/src/wayland/data_device/dnd_grab.rs +++ b/src/wayland/data_device/dnd_grab.rs @@ -69,9 +69,9 @@ impl PointerGrab for DnDGrab { // focus changed, we need to make a leave if appropriate if let Some(surface) = self.current_focus.take() { // only leave if there is a data source or we are on the original client - if self.data_source.is_some() || self.origin.as_ref().same_client_as(&surface.as_ref()) { + if self.data_source.is_some() || self.origin.as_ref().same_client_as(surface.as_ref()) { for device in &seat_data.known_devices { - if device.as_ref().same_client_as(&surface.as_ref()) { + if device.as_ref().same_client_as(surface.as_ref()) { device.leave(); } } @@ -102,7 +102,7 @@ impl PointerGrab for DnDGrab { for device in seat_data .known_devices .iter() - .filter(|d| d.as_ref().same_client_as(&surface.as_ref())) + .filter(|d| d.as_ref().same_client_as(surface.as_ref())) { let action_choice = device .as_ref() @@ -138,9 +138,9 @@ impl PointerGrab for DnDGrab { self.offer_data = Some(offer_data); } else { // only send if we are on a surface of the same client - if self.origin.as_ref().same_client_as(&surface.as_ref()) { + if self.origin.as_ref().same_client_as(surface.as_ref()) { for device in &seat_data.known_devices { - if device.as_ref().same_client_as(&surface.as_ref()) { + if device.as_ref().same_client_as(surface.as_ref()) { device.enter(serial.into(), &surface, x, y, None); } } @@ -149,9 +149,9 @@ impl PointerGrab for DnDGrab { self.current_focus = Some(surface); } else { // make a move - if self.data_source.is_some() || self.origin.as_ref().same_client_as(&surface.as_ref()) { + if self.data_source.is_some() || self.origin.as_ref().same_client_as(surface.as_ref()) { for device in &seat_data.known_devices { - if device.as_ref().same_client_as(&surface.as_ref()) { + if device.as_ref().same_client_as(surface.as_ref()) { device.motion(time, x, y); } } @@ -183,7 +183,7 @@ impl PointerGrab for DnDGrab { false }; if let Some(ref surface) = self.current_focus { - if self.data_source.is_some() || self.origin.as_ref().same_client_as(&surface.as_ref()) { + if self.data_source.is_some() || self.origin.as_ref().same_client_as(surface.as_ref()) { for device in &seat_data.known_devices { if device.as_ref().same_client_as(surface.as_ref()) { if validated { diff --git a/src/wayland/data_device/mod.rs b/src/wayland/data_device/mod.rs index 0579f78..4a6247e 100644 --- a/src/wayland/data_device/mod.rs +++ b/src/wayland/data_device/mod.rs @@ -491,7 +491,7 @@ where .unwrap() .borrow_mut() .known_devices - .retain(|ndd| ndd.as_ref().is_alive() && (!ndd.as_ref().equals(&dd.as_ref()))) + .retain(|ndd| ndd.as_ref().is_alive() && (!ndd.as_ref().equals(dd.as_ref()))) } _ => unreachable!(), }); diff --git a/src/wayland/data_device/server_dnd_grab.rs b/src/wayland/data_device/server_dnd_grab.rs index fd9e447..a1a554b 100644 --- a/src/wayland/data_device/server_dnd_grab.rs +++ b/src/wayland/data_device/server_dnd_grab.rs @@ -92,7 +92,7 @@ where // focus changed, we need to make a leave if appropriate if let Some(surface) = self.current_focus.take() { for device in &seat_data.known_devices { - if device.as_ref().same_client_as(&surface.as_ref()) { + if device.as_ref().same_client_as(surface.as_ref()) { device.leave(); } } @@ -121,7 +121,7 @@ where for device in seat_data .known_devices .iter() - .filter(|d| d.as_ref().same_client_as(&surface.as_ref())) + .filter(|d| d.as_ref().same_client_as(surface.as_ref())) { let action_choice = device .as_ref() @@ -157,7 +157,7 @@ where } else { // make a move for device in &seat_data.known_devices { - if device.as_ref().same_client_as(&surface.as_ref()) { + if device.as_ref().same_client_as(surface.as_ref()) { device.motion(time, x, y); } } diff --git a/src/wayland/dmabuf/mod.rs b/src/wayland/dmabuf/mod.rs index 5497710..b9e6499 100644 --- a/src/wayland/dmabuf/mod.rs +++ b/src/wayland/dmabuf/mod.rs @@ -249,14 +249,7 @@ where } }; - if !buffer_basic_checks( - &self.formats, - &self.pending_planes, - ¶ms, - format, - width, - height, - ) { + if !buffer_basic_checks(&self.formats, &self.pending_planes, params, format, width, height) { trace!(self.log, "Killing client providing bogus dmabuf buffer params."); return; } @@ -338,14 +331,7 @@ where } }; - if !buffer_basic_checks( - &self.formats, - &self.pending_planes, - ¶ms, - format, - width, - height, - ) { + if !buffer_basic_checks(&self.formats, &self.pending_planes, params, format, width, height) { trace!(self.log, "Killing client providing bogus dmabuf buffer params."); return; } diff --git a/src/wayland/explicit_synchronization/mod.rs b/src/wayland/explicit_synchronization/mod.rs index 75327ed..c194bea 100644 --- a/src/wayland/explicit_synchronization/mod.rs +++ b/src/wayland/explicit_synchronization/mod.rs @@ -159,7 +159,7 @@ impl std::error::Error for NoExplicitSync {} /// the client associated with this `SurfaceAttributes` will be killed as a result of calling this /// function. pub fn send_explicit_synchronization_error(attrs: &SurfaceData, error: ExplicitSyncError) { - if let Some(ref data) = attrs.data_map.get::() { + if let Some(data) = attrs.data_map.get::() { if let Some(sync_resource) = data.state.borrow().deref() { match error { ExplicitSyncError::InvalidFence => sync_resource.as_ref().post_error( diff --git a/src/wayland/output/mod.rs b/src/wayland/output/mod.rs index 6e1170c..fff44b1 100644 --- a/src/wayland/output/mod.rs +++ b/src/wayland/output/mod.rs @@ -215,7 +215,7 @@ impl Output { .lock() .unwrap() .instances - .retain(|o| !o.as_ref().equals(&output.as_ref())); + .retain(|o| !o.as_ref().equals(output.as_ref())); })); output.as_ref().user_data().set_threadsafe({ let inner = inner.clone(); diff --git a/src/wayland/output/xdg.rs b/src/wayland/output/xdg.rs index c7401ea..0a8e5a7 100644 --- a/src/wayland/output/xdg.rs +++ b/src/wayland/output/xdg.rs @@ -92,7 +92,7 @@ impl XdgOutput { .lock() .unwrap() .instances - .retain(|o| !o.as_ref().equals(&xdg_output.as_ref())); + .retain(|o| !o.as_ref().equals(xdg_output.as_ref())); })); xdg_output.as_ref().user_data().set_threadsafe({ let xdg_output = self.clone(); diff --git a/src/wayland/seat/keyboard.rs b/src/wayland/seat/keyboard.rs index f994bfc..99fc320 100644 --- a/src/wayland/seat/keyboard.rs +++ b/src/wayland/seat/keyboard.rs @@ -377,7 +377,7 @@ impl KeyboardHandle { if !same { // unset old focus guard.with_focused_kbds(|kbd, s| { - kbd.leave(serial.into(), &s); + kbd.leave(serial.into(), s); }); // set new focus @@ -385,7 +385,7 @@ impl KeyboardHandle { let (dep, la, lo, gr) = guard.serialize_modifiers(); let keys = guard.serialize_pressed_keys(); guard.with_focused_kbds(|kbd, surface| { - kbd.enter(serial.into(), &surface, keys.clone()); + kbd.enter(serial.into(), surface, keys.clone()); // Modifiers must be send after enter event. kbd.modifiers(serial.into(), dep, la, lo, gr); }); @@ -481,7 +481,7 @@ pub(crate) fn implement_keyboard(keyboard: Main, handle: Option<&Key arc.internal .borrow_mut() .known_kbds - .retain(|k| !k.as_ref().equals(&keyboard.as_ref())) + .retain(|k| !k.as_ref().equals(keyboard.as_ref())) })); } diff --git a/src/wayland/seat/mod.rs b/src/wayland/seat/mod.rs index d8b2ec0..8e9dd5f 100644 --- a/src/wayland/seat/mod.rs +++ b/src/wayland/seat/mod.rs @@ -360,7 +360,7 @@ fn implement_seat(seat: Main, arc: Rc) -> wl_seat::WlSe .inner .borrow_mut() .known_seats - .retain(|s| !s.as_ref().equals(&seat.as_ref())); + .retain(|s| !s.as_ref().equals(seat.as_ref())); })); seat.as_ref().user_data().set(move || arc); diff --git a/src/wayland/seat/pointer.rs b/src/wayland/seat/pointer.rs index 295ba96..0fc1882 100644 --- a/src/wayland/seat/pointer.rs +++ b/src/wayland/seat/pointer.rs @@ -377,7 +377,7 @@ impl<'a> PointerInnerHandle<'a> { } if leave { self.inner.with_focused_pointers(|pointer, surface| { - pointer.leave(serial.into(), &surface); + pointer.leave(serial.into(), surface); if pointer.as_ref().version() >= 5 { pointer.frame(); } @@ -395,7 +395,7 @@ impl<'a> PointerInnerHandle<'a> { let (x, y) = (location - surface_location.to_f64()).into(); if entered { self.inner.with_focused_pointers(|pointer, surface| { - pointer.enter(serial.into(), &surface, x, y); + pointer.enter(serial.into(), surface, x, y); if pointer.as_ref().version() >= 5 { pointer.frame(); } @@ -588,7 +588,7 @@ pub(crate) fn implement_pointer(pointer: Main, handle: Option<&Pointe .. } = *guard; if let Some((ref focus, _)) = *focus { - if focus.as_ref().same_client_as(&pointer.as_ref()) { + if focus.as_ref().same_client_as(pointer.as_ref()) { match surface { Some(surface) => { // tolerate re-using the same surface @@ -640,7 +640,7 @@ pub(crate) fn implement_pointer(pointer: Main, handle: Option<&Pointe inner .borrow_mut() .known_pointers - .retain(|p| !p.as_ref().equals(&pointer.as_ref())) + .retain(|p| !p.as_ref().equals(pointer.as_ref())) })) } diff --git a/src/wayland/tablet_manager/tablet.rs b/src/wayland/tablet_manager/tablet.rs index bb1c8a2..929e7c9 100644 --- a/src/wayland/tablet_manager/tablet.rs +++ b/src/wayland/tablet_manager/tablet.rs @@ -57,7 +57,7 @@ impl TabletHandle { inner .borrow_mut() .instances - .retain(|i| !i.as_ref().equals(&instance.as_ref())); + .retain(|i| !i.as_ref().equals(instance.as_ref())); })); seat.tablet_added(&wl_tablet); diff --git a/src/wayland/tablet_manager/tablet_seat.rs b/src/wayland/tablet_manager/tablet_seat.rs index 71f1ae0..7415056 100644 --- a/src/wayland/tablet_manager/tablet_seat.rs +++ b/src/wayland/tablet_manager/tablet_seat.rs @@ -75,7 +75,7 @@ impl TabletSeatHandle { inner .borrow_mut() .instances - .retain(|i| !i.as_ref().equals(&seat.as_ref())); + .retain(|i| !i.as_ref().equals(seat.as_ref())); })); } diff --git a/src/wayland/tablet_manager/tablet_tool.rs b/src/wayland/tablet_manager/tablet_tool.rs index 751f0db..120346a 100644 --- a/src/wayland/tablet_manager/tablet_tool.rs +++ b/src/wayland/tablet_manager/tablet_tool.rs @@ -257,7 +257,7 @@ impl TabletToolHandle { let inner = inner.borrow(); if let Some(ref focus) = inner.focus { - if focus.as_ref().same_client_as(&tool.as_ref()) { + if focus.as_ref().same_client_as(tool.as_ref()) { if let Some(surface) = surface { // tolerate re-using the same surface if compositor::give_role(&surface, CURSOR_IMAGE_ROLE).is_err() @@ -305,7 +305,7 @@ impl TabletToolHandle { inner .borrow_mut() .instances - .retain(|i| !i.as_ref().equals(&instance.as_ref())); + .retain(|i| !i.as_ref().equals(instance.as_ref())); })); seat.tool_added(&wl_tool);