Skip to content

Commit

Permalink
clippy: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
technobaboo committed Aug 20, 2024
1 parent 6146a5b commit 21d10a1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
3 changes: 3 additions & 0 deletions src/nodes/input/hand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ impl Default for Joint {
}
}
}
#[allow(clippy::derivable_impls)]
impl Default for Finger {
fn default() -> Self {
Finger {
Expand All @@ -25,6 +26,7 @@ impl Default for Finger {
}
}
}
#[allow(clippy::derivable_impls)]
impl Default for Thumb {
fn default() -> Self {
Thumb {
Expand All @@ -35,6 +37,7 @@ impl Default for Thumb {
}
}
}
#[allow(clippy::derivable_impls)]
impl Default for Hand {
fn default() -> Self {
Hand {
Expand Down
2 changes: 1 addition & 1 deletion src/objects/input/mouse_pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 2 additions & 10 deletions src/wayland/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>> {
Expand Down
12 changes: 4 additions & 8 deletions src/wayland/xdg_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,10 @@ 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 {
origin: [0; 2].into(),
size: initial_size,
}),
logical_rectangle: toplevel.wl_surface().get_geometry().unwrap_or(Geometry {
origin: [0; 2].into(),
size: initial_size,
}),
};
toplevel
.wl_surface()
Expand Down

0 comments on commit 21d10a1

Please sign in to comment.