yoda: warning cleanup sweep (dead code + clippy --fix) (squashed)

Squash of 4 yoda commits:
- 84437e21 yoda: libcosmic-yoda dead-code purge (14->0 warnings)
- 999db0a4 yoda: cosmic-theme cleanup (4->0 warnings) — workspace at 0 warnings total
- 4743bb8e yoda: cargo clippy --fix on libcosmic-yoda (115->33 warnings)
- 675f3b59 chore: reduce local stack warnings
This commit is contained in:
Lionel DARNIS 2026-05-25 13:02:38 +02:00
parent c85efc6180
commit 4e1080108c
35 changed files with 173 additions and 210 deletions

View file

@ -379,13 +379,12 @@ impl<'a, Message: 'a + Clone> Widget<Message, crate::Theme, crate::Renderer>
match event {
Event::Mouse(mouse::Event::ButtonReleased(mouse::Button::Left))
| Event::Touch(touch::Event::FingerPressed { .. }) => {
if let Some(position) = cursor.position() {
if removal_bounds(layout.bounds(), 4.0).contains(position) {
if let Some(position) = cursor.position()
&& removal_bounds(layout.bounds(), 4.0).contains(position) {
shell.publish(on_remove.clone());
shell.capture_event();
return;
}
}
}
_ => (),
@ -576,9 +575,9 @@ impl<'a, Message: 'a + Clone> Widget<Message, crate::Theme, crate::Renderer>
}
}
if on_remove.is_some() {
if let Some(position) = cursor.position() {
if bounds.contains(position) {
if on_remove.is_some()
&& let Some(position) = cursor.position()
&& bounds.contains(position) {
let bounds = removal_bounds(layout.bounds(), 4.0);
renderer.fill_quad(
renderer::Quad {
@ -610,8 +609,6 @@ impl<'a, Message: 'a + Clone> Widget<Message, crate::Theme, crate::Renderer>
},
);
}
}
}
});
}
}
@ -762,12 +759,6 @@ impl State {
self.is_focused
}
/// Returns whether the [`Button`] is currently hovered or not.
#[inline]
pub fn is_hovered(self) -> bool {
self.is_hovered
}
/// Focuses the [`Button`].
#[inline]
pub fn focus(&mut self) {
@ -813,7 +804,6 @@ pub fn update<'a, Message: Clone>(
}
shell.capture_event();
return;
}
}
}
@ -833,7 +823,6 @@ pub fn update<'a, Message: Clone>(
}
shell.capture_event();
return;
}
} else if on_press_down.is_some() {
let state = state();
@ -853,7 +842,6 @@ pub fn update<'a, Message: Clone>(
shell.publish(msg);
}
shell.capture_event();
return;
}
Event::Keyboard(keyboard::Event::KeyPressed { key, .. }) => {
if let Some(on_press) = on_press {
@ -864,7 +852,6 @@ pub fn update<'a, Message: Clone>(
shell.publish(msg);
shell.capture_event();
return;
}
}
}