yoda: cargo fix --lib across all crates — drop ~115 trivial warnings
Some checks are pending
Audit / vulnerabilities (push) Waiting to run
Check / wasm (push) Waiting to run
Check / widget (push) Waiting to run
Document / all (push) Waiting to run
Format / all (push) Waiting to run
Lint / all (push) Waiting to run
Test / all (macOS-latest, 1.88) (push) Waiting to run
Test / all (macOS-latest, beta) (push) Waiting to run
Test / all (macOS-latest, stable) (push) Waiting to run
Test / all (ubuntu-latest, 1.88) (push) Waiting to run
Test / all (ubuntu-latest, beta) (push) Waiting to run
Test / all (ubuntu-latest, stable) (push) Waiting to run
Test / all (windows-latest, 1.88) (push) Waiting to run
Test / all (windows-latest, beta) (push) Waiting to run
Test / all (windows-latest, stable) (push) Waiting to run

Auto-applied suggestions (unused imports, _-prefixed unused params,
redundant mutability) on iced_core, iced_widget, iced_runtime, iced_winit,
iced_wgpu, iced_graphics, iced_tiny_skia. From 170 warnings down to 55.

Leyoda 2026 – GPLv3
This commit is contained in:
Votre Nom 2026-05-05 16:45:37 +02:00
parent f388dfdfe4
commit 8a7a32ff92
45 changed files with 85 additions and 139 deletions

View file

@ -4,7 +4,6 @@ use crate::futures::futures::channel::mpsc;
use iced_accessibility::accesskit::{
ActivationHandler, Node, NodeId, Role, Tree, TreeId, TreeUpdate,
};
use iced_accessibility::accesskit_winit::Adapter;
use iced_runtime::core;
pub struct WinitActivationHandler {

View file

@ -25,7 +25,7 @@ const DRAG_RESIZE_SUPPORTED: bool = false;
/// If supported by winit, returns a closure that implements cursor resize support.
pub fn event_func(
window: &dyn winit::window::Window,
_window: &dyn winit::window::Window,
border_size: f64,
) -> Option<
Box<

View file

@ -1,7 +1,7 @@
//! Access the clipboard.
use std::sync::Mutex;
use std::{any::Any, borrow::Cow};
use std::borrow::Cow;
use crate::Control;

View file

@ -3,7 +3,6 @@
//! [`winit`]: https://github.com/rust-windowing/winit
//! [`iced_runtime`]: https://github.com/iced-rs/iced/tree/0.14/runtime
use crate::core::input_method;
use std::hash::DefaultHasher;
use std::hash::Hash;
use std::hash::Hasher;
use std::sync::Arc;
@ -14,7 +13,6 @@ use crate::core::theme;
use crate::core::touch;
use crate::core::window;
use crate::core::{Event, Point, Size};
use iced_futures::core::event::PlatformSpecific;
use winit::dpi::PhysicalPosition;
use winit::event::ButtonSource;
use winit::event::ElementState;
@ -27,7 +25,7 @@ use winit::keyboard::SmolStr;
pub fn window_attributes(
settings: window::Settings,
title: &str,
scale_factor: f64,
_scale_factor: f64,
primary_monitor: Option<winit::monitor::MonitorHandle>,
_id: Option<String>,
) -> winit::window::WindowAttributes {
@ -396,8 +394,8 @@ pub fn window_event(
Ime::Commit(content) => input_method::Event::Commit(content),
Ime::Disabled => input_method::Event::Closed,
Ime::DeleteSurrounding {
before_bytes,
after_bytes,
before_bytes: _,
after_bytes: _,
} => todo!(),
})),
WindowEvent::Focused(focused) => Some(Event::Window(if focused {
@ -411,7 +409,7 @@ pub fn window_event(
WindowEvent::DragDropped { paths, .. } => {
Some(Event::Window(window::Event::FileDropped(paths.clone())))
}
WindowEvent::DragLeft { position } => {
WindowEvent::DragLeft { position: _ } => {
Some(Event::Window(window::Event::FilesHoveredLeft))
}
@ -707,7 +705,7 @@ enum TouchInternal {
pub fn touch_event(
finger: FingerId,
state: TouchInternal,
force: Option<Force>,
_force: Option<Force>,
position: Option<PhysicalPosition<f64>>,
scale_factor: f64,
) -> touch::Event {

View file

@ -53,7 +53,6 @@ mod window;
pub use clipboard::Clipboard;
pub use error::Error;
pub use proxy::Proxy;
use winit::dpi::LogicalSize;
use winit::dpi::PhysicalPosition;
use winit::dpi::PhysicalSize;
@ -322,9 +321,9 @@ where
// create initial window
let Some(BootConfig {
sender,
fonts,
graphics_settings,
is_wayland,
fonts: _,
graphics_settings: _,
is_wayland: _,
}) = self.boot.take()
else {
return;
@ -636,10 +635,7 @@ where
#[cfg(feature = "a11y")]
fn init_adapter(&mut self, event_loop: &(dyn winit::event_loop::ActiveEventLoop + 'static), id: core::window::Id, window: Arc<dyn winit::window::Window + 'static>) {
use crate::a11y::*;
use iced_accessibility::accesskit::{
ActivationHandler, Node, NodeId, Role,
Tree, TreeUpdate,
};
use iced_accessibility::accesskit_winit::Adapter;
let node_id =

View file

@ -1,14 +1,11 @@
//! Wayland specific shell
//!
use std::{borrow::Cow, collections::HashMap, sync::Arc};
use std::collections::HashMap;
#[cfg(all(feature = "cctk", target_os = "linux"))]
use cctk::sctk::reexports::client::Connection;
use iced_graphics::{Compositor, compositor};
use iced_runtime::{
core::{Vector, window},
platform_specific, user_interface,
core::{Vector, window}, user_interface,
};
use winit::raw_window_handle::HasWindowHandle;
@ -17,8 +14,6 @@ pub mod wayland;
#[cfg(all(feature = "cctk", target_os = "linux"))]
pub use wayland::*;
#[cfg(all(feature = "cctk", target_os = "linux"))]
use wayland_backend::client::Backend;
use crate::{CreateCompositor, Program, WindowManager};

View file

@ -2,8 +2,6 @@ pub mod control_flow;
pub mod proxy;
pub mod state;
#[cfg(feature = "a11y")]
use crate::platform_specific::SurfaceIdWrapper;
use crate::{
Control,
futures::futures::channel::mpsc,
@ -43,8 +41,6 @@ use cctk::{
};
use raw_window_handle::HasDisplayHandle;
use state::{FrameStatus, SctkWindow, send_event};
#[cfg(feature = "a11y")]
use std::sync::{Arc, Mutex};
use std::{
collections::{HashMap, HashSet},
fmt::Debug,

View file

@ -29,7 +29,6 @@ use std::{
convert::Infallible,
fmt::Debug,
sync::{Arc, Mutex, atomic::AtomicU32},
thread::panicking,
time::Duration,
};
use wayland_backend::client::ObjectId;
@ -50,7 +49,6 @@ use cctk::{
activation::{ActivationState, RequestData},
compositor::CompositorState,
error::GlobalError,
globals::GlobalData,
output::OutputState,
reexports::{
calloop::{LoopHandle, timer::TimeoutAction},
@ -1258,7 +1256,7 @@ impl SctkState {
let timer = cctk::sctk::reexports::calloop::timer::Timer::from_duration(Duration::from_millis(30));
let queue_handle = self.queue_handle.clone();
_ = self.loop_handle.insert_source(timer, move |_, _, state| {
let Some((mut popup, attempt)) = state.pending_popup.take() else {
let Some((popup, attempt)) = state.pending_popup.take() else {
return TimeoutAction::Drop;
};
@ -1574,7 +1572,7 @@ impl SctkState {
if let Some(manager) = self.corner_radius_manager.as_ref() {
if let Some(w) = self.windows.iter_mut().find(|w| w.id == id) {
let geo_size: LogicalSize<f64> = w.window.surface_size().cast::<f64>().to_logical(w.window.scale_factor());
let half_min_dim = ((geo_size.width as u32).min(geo_size.height as u32) / 2);
let half_min_dim = (geo_size.width as u32).min(geo_size.height as u32) / 2 ;
if let Some(radii) = v {
let adjusted_radii = CornerRadius {

View file

@ -3,7 +3,6 @@ use cctk::sctk::{
delegate_activation,
reexports::client::protocol::{wl_seat::WlSeat, wl_surface::WlSurface},
};
use iced_futures::futures::channel::oneshot::Sender;
use crate::platform_specific::wayland::event_loop::state::SctkState;

View file

@ -18,7 +18,7 @@ impl SeatHandler for SctkState {
fn new_seat(
&mut self,
_conn: &cctk::sctk::reexports::client::Connection,
qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
seat: cctk::sctk::reexports::client::protocol::wl_seat::WlSeat,
) {
self.sctk_events.push(SctkEvent::SeatEvent {

View file

@ -1,17 +1,13 @@
use cctk::{sctk, cosmic_protocols::{
corner_radius::v1::client::{
use cctk::{sctk, cosmic_protocols::corner_radius::v1::client::{
cosmic_corner_radius_manager_v1::CosmicCornerRadiusManagerV1,
cosmic_corner_radius_toplevel_v1::CosmicCornerRadiusToplevelV1,
},
overlap_notify::v1::client::zcosmic_overlap_notification_v1::ZcosmicOverlapNotificationV1,
}};
}};
use sctk::reexports::{
client::{Connection, Dispatch, Proxy},
};
use crate::event_loop::state::SctkState;
use crate::platform_specific::wayland::SctkEvent;
impl Dispatch<CosmicCornerRadiusManagerV1, ()> for SctkState {
fn event(
@ -31,7 +27,7 @@ impl
> for SctkState
{
fn event(
state: &mut Self,
_state: &mut Self,
_proxy: &CosmicCornerRadiusToplevelV1,
event: <CosmicCornerRadiusToplevelV1 as Proxy>::Event,
_data: &(),

View file

@ -18,7 +18,7 @@ use cursor_icon::CursorIcon;
use iced_futures::futures::channel::mpsc;
use iced_graphics::{Compositor, compositor};
use iced_runtime::core::{Vector, window};
use raw_window_handle::{DisplayHandle, HasDisplayHandle, HasWindowHandle};
use raw_window_handle::{HasDisplayHandle, HasWindowHandle};
use raw_window_handle::{HasRawDisplayHandle, RawWindowHandle};
use sctk_event::SctkEvent;
use std::{collections::HashMap, sync::Arc};
@ -189,12 +189,12 @@ impl WaylandSpecific {
winit_event_sender,
proxy,
sender,
display_handle,
conn,
display_handle: _,
conn: _,
surface_ids,
modifiers,
subsurface_state,
surface_subsurfaces,
surface_subsurfaces: _,
} = self;
match e {
@ -237,7 +237,7 @@ impl WaylandSpecific {
&mut self,
keep: F,
) {
self.surface_subsurfaces.retain(|k, v| keep(*k))
self.surface_subsurfaces.retain(|k, _v| keep(*k))
}
pub(crate) fn clear_subsurface_list(&mut self) {
@ -250,7 +250,7 @@ impl WaylandSpecific {
wl_surface: &WlSurface,
) {
let subsurfaces = crate::subsurface_widget::take_subsurfaces();
let mut entry = self.surface_subsurfaces.entry(id);
let entry = self.surface_subsurfaces.entry(id);
let surface_subsurfaces = entry.or_default();
let Some(subsurface_state) = self.subsurface_state.as_mut() else {
return;

View file

@ -4,7 +4,7 @@ use crate::{
SurfaceIdWrapper, UserInterfaces,
wayland::{
conversion::{
modifiers_to_native, pointer_axis_to_native,
modifiers_to_native,
pointer_button_to_native,
},
keymap::{self, keysym_to_key},
@ -25,7 +25,6 @@ use iced_futures::{
},
},
},
event,
futures::{SinkExt, channel::mpsc},
};
use iced_graphics::{Compositor, compositor};
@ -40,9 +39,7 @@ use iced_runtime::{
user_interface,
};
use cctk::{
cosmic_protocols::overlap_notify::v1::client::zcosmic_overlap_notification_v1,
sctk::{
use cctk::sctk::{
output::OutputInfo,
reexports::{
calloop::channel,
@ -67,11 +64,8 @@ use cctk::{
wlr_layer::{Layer, LayerSurfaceConfigure},
xdg::{popup::PopupConfigure, window::WindowConfigure},
},
},
wayland_client::protocol::wl_subsurface::WlSubsurface,
};
};
use std::{
any::Any,
collections::HashMap,
num::NonZeroU32,
sync::{Arc, Mutex},
@ -510,7 +504,7 @@ impl SctkEvent {
),
),
),
SurfaceIdWrapper::Window(id) => {
SurfaceIdWrapper::Window(_id) => {
Some(iced_runtime::core::Event::Window(
window::Event::Unfocused,
))
@ -538,7 +532,7 @@ impl SctkEvent {
),
),
),
SurfaceIdWrapper::Subsurface(id) => None,
SurfaceIdWrapper::Subsurface(_id) => None,
})
{
events.push((
@ -572,7 +566,7 @@ impl SctkEvent {
),
),
),
SurfaceIdWrapper::Window(id) => {
SurfaceIdWrapper::Window(_id) => {
Some(iced_runtime::core::Event::Window(
window::Event::Focused,
))

View file

@ -58,9 +58,7 @@ use wayland_protocols::wp::{
};
use winit::window::WindowId;
use crate::platform_specific::{
SurfaceIdWrapper, event_loop::state::SctkState,
};
use crate::platform_specific::event_loop::state::SctkState;
#[derive(Debug)]
pub struct Plane {

View file

@ -1,9 +1,9 @@
use crate::platform_specific::wayland::Action;
use cctk::sctk::reexports::{
calloop::{LoopHandle, channel},
calloop::channel,
client::{
Proxy, QueueHandle,
protocol::{wl_display::WlDisplay, wl_surface::WlSurface},
protocol::wl_display::WlDisplay,
},
};
use raw_window_handle::HandleError;
@ -91,7 +91,7 @@ impl winit::window::Window for SctkWinitWindow {
}
}
fn set_cursor_visible(&self, visible: bool) {
fn set_cursor_visible(&self, _visible: bool) {
// TODO
}
@ -203,35 +203,35 @@ impl winit::window::Window for SctkWinitWindow {
// TODO refer to winit for implementation
}
fn set_outer_position(&self, position: winit::dpi::Position) {}
fn set_outer_position(&self, _position: winit::dpi::Position) {}
fn outer_size(&self) -> winit::dpi::PhysicalSize<u32> {
// XXX not applicable to wrapped surfaces
Default::default()
}
fn set_min_surface_size(&self, min_size: Option<winit::dpi::Size>) {
fn set_min_surface_size(&self, _min_size: Option<winit::dpi::Size>) {
// XXX not applicable to wrapped surfaces
}
fn set_max_surface_size(&self, max_size: Option<winit::dpi::Size>) {
fn set_max_surface_size(&self, _max_size: Option<winit::dpi::Size>) {
// XXX not applicable to wrapped surfaces
}
fn set_surface_resize_increments(
&self,
increments: Option<winit::dpi::Size>,
_increments: Option<winit::dpi::Size>,
) {
log::warn!(
"`set_surface_resize_increments` is not implemented for Wayland"
)
}
fn set_title(&self, title: &str) {
fn set_title(&self, _title: &str) {
// XXX not applicable to wrapped surfaces
}
fn set_transparent(&self, transparent: bool) {
fn set_transparent(&self, _transparent: bool) {
todo!()
}
@ -286,23 +286,23 @@ impl winit::window::Window for SctkWinitWindow {
_ = self.tx.send(Action::SetImePurpose(purpose));
}
fn set_blur(&self, blur: bool) {
fn set_blur(&self, _blur: bool) {
// TODO
}
fn set_visible(&self, visible: bool) {}
fn set_visible(&self, _visible: bool) {}
fn is_visible(&self) -> Option<bool> {
None
}
fn set_resizable(&self, resizable: bool) {}
fn set_resizable(&self, _resizable: bool) {}
fn is_resizable(&self) -> bool {
false
}
fn set_enabled_buttons(&self, buttons: winit::window::WindowButtons) {
fn set_enabled_buttons(&self, _buttons: winit::window::WindowButtons) {
// TODO v5 of xdg_shell.
}
@ -310,7 +310,7 @@ impl winit::window::Window for SctkWinitWindow {
WindowButtons::all()
}
fn set_minimized(&self, minimized: bool) {
fn set_minimized(&self, _minimized: bool) {
// XXX not applicable to the wrapped surfaces
}
@ -319,7 +319,7 @@ impl winit::window::Window for SctkWinitWindow {
None
}
fn set_maximized(&self, maximized: bool) {
fn set_maximized(&self, _maximized: bool) {
// XXX can't minimize the wrapped surfaces
}
@ -330,7 +330,7 @@ impl winit::window::Window for SctkWinitWindow {
fn set_fullscreen(
&self,
fullscreen: Option<winit_core::monitor::Fullscreen>,
_fullscreen: Option<winit_core::monitor::Fullscreen>,
) {
// XXX can't fullscreen the wrapped surfaces
}
@ -340,7 +340,7 @@ impl winit::window::Window for SctkWinitWindow {
None
}
fn set_decorations(&self, decorations: bool) {
fn set_decorations(&self, _decorations: bool) {
// XXX no decorations supported for the wrapped surfaces
}
@ -348,26 +348,26 @@ impl winit::window::Window for SctkWinitWindow {
false
}
fn set_window_level(&self, level: winit::window::WindowLevel) {}
fn set_window_level(&self, _level: winit::window::WindowLevel) {}
fn set_window_icon(&self, window_icon: Option<winit_core::icon::Icon>) {}
fn set_window_icon(&self, _window_icon: Option<winit_core::icon::Icon>) {}
fn focus_window(&self) {}
fn request_user_attention(
&self,
request_type: Option<winit::window::UserAttentionType>,
_request_type: Option<winit::window::UserAttentionType>,
) {
// XXX can't request attention on wrapped surfaces
}
fn set_theme(&self, theme: Option<winit::window::Theme>) {}
fn set_theme(&self, _theme: Option<winit::window::Theme>) {}
fn theme(&self) -> Option<winit::window::Theme> {
None
}
fn set_content_protected(&self, protected: bool) {}
fn set_content_protected(&self, _protected: bool) {}
fn title(&self) -> String {
String::new()
@ -420,14 +420,14 @@ impl winit::window::Window for SctkWinitWindow {
fn set_cursor_position(
&self,
position: winit::dpi::Position,
_position: winit::dpi::Position,
) -> Result<(), winit::error::RequestError> {
todo!()
}
fn set_cursor_grab(
&self,
mode: winit::window::CursorGrabMode,
_mode: winit::window::CursorGrabMode,
) -> Result<(), winit::error::RequestError> {
todo!()
}
@ -438,7 +438,7 @@ impl winit::window::Window for SctkWinitWindow {
fn request_ime_update(
&self,
request: winit::window::ImeRequest,
_request: winit::window::ImeRequest,
) -> Result<(), winit::window::ImeRequestError> {
todo!()
}

View file

@ -8,7 +8,6 @@ use crate::futures::futures::{
use crate::graphics::shell;
use crate::runtime::Action;
use crate::runtime::window;
use std::hash::DefaultHasher;
use std::pin::Pin;
/// An event loop proxy with backpressure that implements `Sink`.