From d33d068c17e3a16d2444917820682f934faaa299 Mon Sep 17 00:00:00 2001 From: Votre Nom Date: Tue, 5 May 2026 18:38:57 +0200 Subject: [PATCH] =?UTF-8?q?yoda:=20iced=5Fwidget=20cleanup=20(7=E2=86=920?= =?UTF-8?q?=20warnings)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - overlay/menu.rs:578: real bug fix — List::draw was rendering with text::Wrapping::default() instead of the configured self.text_wrap. Wiring it through eliminates the 'field never read' warning AND honors the wrap setting that was being silently dropped. - slider.rs:735-744: replace `if let Ok(x) = …try_into() { … }` with irrefutable `let Ok(x) = …try_into();` (the conversion is provably Infallible at the call site). Same behavior, no compiler noise. - lazy.rs:8 / lazy/component.rs:13: drop unused `iced_renderer::core::widget::Operation` imports. Leyoda 2026 – GPLv3 --- widget/src/lazy.rs | 1 - widget/src/lazy/component.rs | 1 - widget/src/overlay/menu.rs | 2 +- widget/src/slider.rs | 20 ++++++++------------ 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/widget/src/lazy.rs b/widget/src/lazy.rs index 7a2611ee..b4db46a5 100644 --- a/widget/src/lazy.rs +++ b/widget/src/lazy.rs @@ -5,7 +5,6 @@ pub mod component; #[allow(deprecated)] pub use component::Component; -use iced_renderer::core::widget::Operation; mod cache; diff --git a/widget/src/lazy/component.rs b/widget/src/lazy/component.rs index 682fd458..b3c51f37 100644 --- a/widget/src/lazy/component.rs +++ b/widget/src/lazy/component.rs @@ -10,7 +10,6 @@ use crate::core::{ self, Clipboard, Element, Length, Rectangle, Shell, Size, Vector, Widget, }; -use iced_renderer::core::widget::Operation; use ouroboros::self_referencing; use std::cell::RefCell; use std::marker::PhantomData; diff --git a/widget/src/overlay/menu.rs b/widget/src/overlay/menu.rs index 94d2b6ad..e7c4dc23 100644 --- a/widget/src/overlay/menu.rs +++ b/widget/src/overlay/menu.rs @@ -575,7 +575,7 @@ where align_x: text::Alignment::Default, align_y: alignment::Vertical::Center, shaping: self.text_shaping, - wrapping: text::Wrapping::default(), + wrapping: self.text_wrap, ellipsize: text::Ellipsize::default(), }, Point::new(bounds.x + self.padding.left, bounds.center_y()), diff --git a/widget/src/slider.rs b/widget/src/slider.rs index e3fe484a..9516f55c 100644 --- a/widget/src/slider.rs +++ b/widget/src/slider.rs @@ -732,18 +732,14 @@ where node.set_labelled_by(label.clone()); } - if let Ok(min) = self.range.start().clone().try_into() { - node.set_min_numeric_value(min); - } - if let Ok(max) = self.range.end().clone().try_into() { - node.set_max_numeric_value(max); - } - if let Ok(value) = self.value.clone().try_into() { - node.set_numeric_value(value); - } - if let Ok(step) = self.step.clone().try_into() { - node.set_numeric_value_step(step); - } + let Ok(min) = self.range.start().clone().try_into(); + node.set_min_numeric_value(min); + let Ok(max) = self.range.end().clone().try_into(); + node.set_max_numeric_value(max); + let Ok(value) = self.value.clone().try_into(); + node.set_numeric_value(value); + let Ok(step) = self.step.clone().try_into(); + node.set_numeric_value_step(step); // TODO: This could be a setting on the slider node.set_live(iced_accessibility::accesskit::Live::Polite);