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:
parent
282813c80e
commit
cdf349385b
35 changed files with 85 additions and 104 deletions
|
|
@ -8,9 +8,8 @@ use std::sync::{Arc, Mutex};
|
|||
|
||||
pub use appearance::{Appearance, StyleSheet};
|
||||
|
||||
use crate::surface;
|
||||
use crate::widget::{Container, RcWrapper, icon};
|
||||
use iced_core::event::{self, Event};
|
||||
use iced_core::event::Event;
|
||||
use iced_core::layout::{self, Layout};
|
||||
use iced_core::text::{self, Text};
|
||||
use iced_core::widget::Tree;
|
||||
|
|
@ -391,7 +390,7 @@ impl<'a, Message: Clone + 'a> crate::widget::Widget<Message, crate::Theme, crate
|
|||
|
||||
fn draw(
|
||||
&self,
|
||||
tree: &Tree,
|
||||
_tree: &Tree,
|
||||
renderer: &mut crate::Renderer,
|
||||
theme: &crate::Theme,
|
||||
style: &renderer::Style,
|
||||
|
|
@ -554,12 +553,12 @@ where
|
|||
|
||||
fn draw(
|
||||
&self,
|
||||
state: &Tree,
|
||||
_state: &Tree,
|
||||
renderer: &mut crate::Renderer,
|
||||
theme: &crate::Theme,
|
||||
style: &renderer::Style,
|
||||
_style: &renderer::Style,
|
||||
layout: Layout<'_>,
|
||||
cursor: mouse::Cursor,
|
||||
_cursor: mouse::Cursor,
|
||||
viewport: &Rectangle,
|
||||
) {
|
||||
let appearance = theme.appearance(&());
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use super::Model;
|
|||
pub use crate::widget::dropdown::menu::{Appearance, StyleSheet};
|
||||
|
||||
use crate::widget::Container;
|
||||
use iced_core::event::{self, Event};
|
||||
use iced_core::event::Event;
|
||||
use iced_core::layout::{self, Layout};
|
||||
use iced_core::text::{self, Text};
|
||||
use iced_core::widget::Tree;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
use super::menu::{self, Menu};
|
||||
use crate::widget::icon;
|
||||
use derive_setters::Setters;
|
||||
use iced_core::event::{self, Event};
|
||||
use iced_core::event::Event;
|
||||
use iced_core::text::{self, Paragraph, Text};
|
||||
use iced_core::widget::tree::{self, Tree};
|
||||
use iced_core::{
|
||||
|
|
@ -13,7 +13,6 @@ use iced_core::{
|
|||
};
|
||||
use iced_core::{Shadow, alignment, keyboard, layout, mouse, overlay, renderer, svg, touch};
|
||||
use iced_widget::pick_list;
|
||||
use std::ffi::OsStr;
|
||||
|
||||
pub use iced_widget::pick_list::{Catalog, Style};
|
||||
|
||||
|
|
@ -253,7 +252,7 @@ impl<Item: Clone + PartialEq + 'static> Default for State<Item> {
|
|||
/// Computes the layout of a [`Dropdown`].
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn layout(
|
||||
renderer: &crate::Renderer,
|
||||
_renderer: &crate::Renderer,
|
||||
limits: &layout::Limits,
|
||||
width: Length,
|
||||
gap: f32,
|
||||
|
|
@ -376,7 +375,7 @@ pub fn mouse_interaction(layout: Layout<'_>, cursor: mouse::Cursor) -> mouse::In
|
|||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn overlay<'a, S: AsRef<str>, Message: 'a, Item: Clone + PartialEq + 'static>(
|
||||
layout: Layout<'_>,
|
||||
renderer: &crate::Renderer,
|
||||
_renderer: &crate::Renderer,
|
||||
state: &'a mut State<Item>,
|
||||
gap: f32,
|
||||
padding: Padding,
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@
|
|||
// SPDX-License-Identifier: MPL-2.0 AND MIT
|
||||
//! Operate on dropdown widgets.
|
||||
|
||||
use super::State;
|
||||
use iced::Rectangle;
|
||||
use iced_core::widget::{Id, Operation};
|
||||
|
||||
pub trait Dropdown {
|
||||
fn close(&mut self);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use crate::widget::icon::{self, Handle};
|
|||
use crate::{Element, surface};
|
||||
use derive_setters::Setters;
|
||||
use iced::window;
|
||||
use iced_core::event::{self, Event};
|
||||
use iced_core::event::Event;
|
||||
use iced_core::text::{self, Paragraph, Text};
|
||||
use iced_core::widget::tree::{self, Tree};
|
||||
use iced_core::{
|
||||
|
|
@ -17,7 +17,6 @@ use iced_core::{
|
|||
use iced_core::{Shadow, alignment, keyboard, layout, mouse, overlay, renderer, svg, touch};
|
||||
use iced_widget::pick_list::{self, Catalog};
|
||||
use std::borrow::Cow;
|
||||
use std::ffi::OsStr;
|
||||
use std::hash::{DefaultHasher, Hash, Hasher};
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::{Arc, LazyLock, Mutex};
|
||||
|
|
@ -328,10 +327,10 @@ where
|
|||
|
||||
fn operate(
|
||||
&mut self,
|
||||
tree: &mut Tree,
|
||||
_tree: &mut Tree,
|
||||
_layout: Layout<'_>,
|
||||
_renderer: &crate::Renderer,
|
||||
operation: &mut dyn iced_core::widget::Operation,
|
||||
_operation: &mut dyn iced_core::widget::Operation,
|
||||
) {
|
||||
// TODO: double check operation handling
|
||||
// let state = tree.state.downcast_mut::<State>();
|
||||
|
|
@ -343,7 +342,7 @@ where
|
|||
tree: &'b mut Tree,
|
||||
layout: Layout<'b>,
|
||||
renderer: &crate::Renderer,
|
||||
viewport: &Rectangle,
|
||||
_viewport: &Rectangle,
|
||||
translation: Vector,
|
||||
) -> Option<overlay::Element<'b, Message, crate::Theme, crate::Renderer>> {
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
|
|
@ -452,7 +451,7 @@ impl super::operation::Dropdown for State {
|
|||
/// Computes the layout of a [`Dropdown`].
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn layout(
|
||||
renderer: &crate::Renderer,
|
||||
_renderer: &crate::Renderer,
|
||||
limits: &layout::Limits,
|
||||
width: Length,
|
||||
gap: f32,
|
||||
|
|
@ -546,7 +545,7 @@ pub fn update<
|
|||
cursor: mouse::Cursor,
|
||||
shell: &mut Shell<'_, Message>,
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
positioner: iced_runtime::platform_specific::wayland::popup::SctkPositioner,
|
||||
_positioner: iced_runtime::platform_specific::wayland::popup::SctkPositioner,
|
||||
on_selected: Arc<dyn Fn(usize) -> Message + Send + Sync + 'static>,
|
||||
selected: Option<usize>,
|
||||
selections: &[S],
|
||||
|
|
@ -558,7 +557,7 @@ pub fn update<
|
|||
gap: f32,
|
||||
padding: Padding,
|
||||
text_size: Option<f32>,
|
||||
font: Option<crate::font::Font>,
|
||||
_font: Option<crate::font::Font>,
|
||||
selected_option: Option<usize>,
|
||||
) {
|
||||
let state = state();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue