yoda: cargo fix --lib (libcosmic-yoda) — drop 99 trivial warnings

Auto-applied suggestions on libcosmic-yoda lib only: unused imports,
unused-by-name params (prefixed with _), redundant mutability. From 113
warnings down to 14 (the 14 remaining are real signals: never-read
fields, unreachable patterns, etc., to be reviewed manually).

Leyoda 2026 – GPLv3
This commit is contained in:
Lionel DARNIS 2026-05-05 16:27:29 +02:00
parent 282813c80e
commit cdf349385b
35 changed files with 85 additions and 104 deletions

View file

@ -21,12 +21,12 @@ use apply::Apply;
use iced::Limits;
use iced::clipboard::dnd::{DndAction, DndEvent, OfferEvent, SourceEvent};
use iced::clipboard::mime::AsMimeTypes;
use iced_core::event::{self, Event};
use iced_core::event::Event;
use iced_core::input_method::{self, InputMethod, Preedit};
use iced_core::mouse::{self, click};
use iced_core::overlay::Group;
use iced_core::renderer::{self, Renderer as CoreRenderer};
use iced_core::text::{self, Affinity, Paragraph, Renderer, Text};
use iced_core::text::{self, Paragraph, Renderer, Text};
use iced_core::time::{Duration, Instant};
use iced_core::touch;
use iced_core::widget::Id;
@ -829,7 +829,7 @@ where
&mut self,
tree: &mut Tree,
layout: Layout<'_>,
renderer: &crate::Renderer,
_renderer: &crate::Renderer,
operation: &mut dyn Operation,
) {
operation.container(Some(&self.id), layout.bounds());
@ -921,7 +921,7 @@ where
// Enable custom buttons defined on the trailing icon position to be handled.
if !self.is_editable_variant {
if let Some(trailing_layout) = trailing_icon_layout {
let res = trailing_icon.as_widget_mut().update(
let _res = trailing_icon.as_widget_mut().update(
tree,
event,
trailing_layout,
@ -2220,7 +2220,7 @@ pub fn update<'a, Message: Clone + 'static>(
)) if *rectangle == Some(dnd_id) => {
cold();
let state = state();
let is_clicked = text_layout.bounds().contains(Point {
let _is_clicked = text_layout.bounds().contains(Point {
x: *x as f32,
y: *y as f32,
});
@ -2228,7 +2228,7 @@ pub fn update<'a, Message: Clone + 'static>(
let mut accepted = false;
for m in mime_types {
if SUPPORTED_TEXT_MIME_TYPES.contains(&m.as_str()) {
let clone = m.clone();
let _clone = m.clone();
accepted = true;
}
}
@ -2291,7 +2291,7 @@ pub fn update<'a, Message: Clone + 'static>(
cold();
let state = state();
if let DndOfferState::HandlingOffer(mime_types, _action) = state.dnd_offer.clone() {
let Some(mime_type) = SUPPORTED_TEXT_MIME_TYPES
let Some(_mime_type) = SUPPORTED_TEXT_MIME_TYPES
.iter()
.find(|&&m| mime_types.iter().any(|t| t == m))
else {
@ -2308,7 +2308,7 @@ pub fn update<'a, Message: Clone + 'static>(
Event::Dnd(DndEvent::Offer(id, OfferEvent::LeaveDestination)) if Some(dnd_id) != *id => {}
#[cfg(all(feature = "wayland", target_os = "linux"))]
Event::Dnd(DndEvent::Offer(
rectangle,
_rectangle,
OfferEvent::Leave | OfferEvent::LeaveDestination,
)) => {
cold();
@ -2611,7 +2611,7 @@ pub fn draw<'a, Message>(
let handling_dnd_offer = !matches!(state.dnd_offer, DndOfferState::None);
#[cfg(not(all(feature = "wayland", target_os = "linux")))]
let handling_dnd_offer = false;
let (cursors, offset, is_selecting) = if let Some(focus) =
let (cursors, offset, _is_selecting) = if let Some(focus) =
state.is_focused.filter(|f| f.focused).or_else(|| {
let now = Instant::now();
handling_dnd_offer.then_some(Focus {