clippy: cleanup

This commit is contained in:
Nova
2024-08-20 16:59:37 -04:00
parent 6146a5b63a
commit 21d10a15ee
4 changed files with 10 additions and 19 deletions

View File

@@ -14,6 +14,7 @@ impl Default for Joint {
}
}
}
#[allow(clippy::derivable_impls)]
impl Default for Finger {
fn default() -> Self {
Finger {
@@ -25,6 +26,7 @@ impl Default for Finger {
}
}
}
#[allow(clippy::derivable_impls)]
impl Default for Thumb {
fn default() -> Self {
Thumb {
@@ -35,6 +37,7 @@ impl Default for Thumb {
}
}
}
#[allow(clippy::derivable_impls)]
impl Default for Hand {
fn default() -> Self {
Hand {

View File

@@ -140,7 +140,7 @@ impl MousePointer {
});
let valid =
result.deepest_point_distance > 0.0 && result.min_distance.is_sign_negative();
valid.then(|| result.deepest_point_distance)
valid.then_some(result.deepest_point_distance)
};
self.capture_manager.update_capture(&self.pointer);

View File

@@ -35,20 +35,12 @@ impl WlSurfaceExt for WlSurface {
}
fn get_current_surface_state(&self) -> SurfaceCachedState {
compositor::with_states(self, |states| {
states
.cached_state
.get::<SurfaceCachedState>()
.current()
.clone()
*states.cached_state.get::<SurfaceCachedState>().current()
})
}
fn get_pending_surface_state(&self) -> SurfaceCachedState {
compositor::with_states(self, |states| {
states
.cached_state
.get::<SurfaceCachedState>()
.pending()
.clone()
*states.cached_state.get::<SurfaceCachedState>().pending()
})
}
fn get_size(&self) -> Option<Vector2<u32>> {

View File

@@ -107,11 +107,7 @@ impl XdgShellHandler for WaylandState {
.wl_surface()
.max_size()
.map(|s| Vector2::from([s.x as f32, s.y as f32])),
logical_rectangle: toplevel
.wl_surface()
.get_geometry()
.map(|r| r.into())
.unwrap_or(Geometry {
logical_rectangle: toplevel.wl_surface().get_geometry().unwrap_or(Geometry {
origin: [0; 2].into(),
size: initial_size,
}),