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

View File

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

View File

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

View File

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