From 6b069b2b4bc252d8fdc4d2a93ff533376c4f0dee Mon Sep 17 00:00:00 2001 From: Votre Nom Date: Tue, 5 May 2026 18:45:49 +0200 Subject: [PATCH] =?UTF-8?q?yoda:=20iced=5Fcore=20+=20iced=5Fwgpu=20cleanup?= =?UTF-8?q?=20(3=E2=86=920=20warnings)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit iced_core/settings.rs: drop dead `From for iced_winit::Settings` impl gated behind a `winit` feature that doesn't exist on iced_core (and shouldn't — that would invert the dep direction). The impl was unreachable code. iced_wgpu/window/compositor.rs: collapse the unused initial `adapter_options` declaration into the only branch that uses it (the fallback path that re-creates the instance with GL allowed). The original allocation was always re-assigned before being read. iced_wgpu/lib.rs: remove `Renderer::draw_overlay` — private debug method with no caller anywhere in the workspace. cargo fix then dropped the imports that became orphans (Color, Size, Vector, alignment). Leyoda 2026 – GPLv3 --- core/src/settings.rs | 10 -------- wgpu/src/lib.rs | 46 +---------------------------------- wgpu/src/window/compositor.rs | 8 +----- 3 files changed, 2 insertions(+), 62 deletions(-) diff --git a/core/src/settings.rs b/core/src/settings.rs index be744b36..2ee1021d 100644 --- a/core/src/settings.rs +++ b/core/src/settings.rs @@ -63,13 +63,3 @@ impl Default for Settings { } } -#[cfg(feature = "winit")] -impl From for iced_winit::Settings { - fn from(settings: Settings) -> iced_winit::Settings { - iced_winit::Settings { - id: settings.id, - fonts: settings.fonts, - is_daemon: settings.is_daemon, - } - } -} diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index 830f9911..4b22ad0a 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -65,7 +65,7 @@ pub use geometry::Geometry; use crate::core::renderer; use crate::core::{ Background, Color, Font, Pixels, Point, Rectangle, Size, - Transformation, Vector, + Transformation, }; use crate::graphics::mesh; use crate::graphics::text::{Editor, Paragraph}; @@ -671,50 +671,6 @@ impl Renderer { }); } - fn draw_overlay( - &mut self, - overlay: &[impl AsRef], - viewport: &Viewport, - ) { - use crate::core::Renderer as _; - use crate::core::alignment; - use crate::core::text::Renderer as _; - - self.with_layer( - Rectangle::with_size(viewport.logical_size()), - |renderer| { - for (i, line) in overlay.iter().enumerate() { - let text = crate::core::Text { - content: line.as_ref().to_owned(), - bounds: viewport.logical_size(), - size: Pixels(20.0), - line_height: core::text::LineHeight::default(), - font: Font::MONOSPACE, - align_x: core::text::Alignment::Left, - align_y: alignment::Vertical::Top, - shaping: core::text::Shaping::Advanced, - wrapping: core::text::Wrapping::Word, - ellipsize: core::text::Ellipsize::None, - }; - - renderer.fill_text( - text.clone(), - Point::new(11.0, 11.0 + 25.0 * i as f32), - Color::from_rgba(0.9, 0.9, 0.9, 1.0), - Rectangle::with_size(Size::INFINITE), - ); - - renderer.fill_text( - text, - Point::new(11.0, 11.0 + 25.0 * i as f32) - + Vector::new(-1.0, -1.0), - Color::BLACK, - Rectangle::with_size(Size::INFINITE), - ); - } - }, - ); - } } impl core::Renderer for Renderer { diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index 56c01980..a7009d14 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -138,12 +138,6 @@ impl Compositor { .clone() .and_then(|window| instance.create_surface(window).ok()); - let mut adapter_options = wgpu::RequestAdapterOptions { - power_preference: wgpu::PowerPreference::from_env() - .unwrap_or(wgpu::PowerPreference::HighPerformance), - compatible_surface: compatible_surface.as_ref(), - force_fallback_adapter: false, - }; let mut adapter = None; #[cfg_attr(not(unix), allow(dead_code))] if std::env::var_os("WGPU_ADAPTER_NAME").is_none() { @@ -205,7 +199,7 @@ impl Compositor { .await; compatible_surface = compatible_window .and_then(|window| instance.create_surface(window).ok()); - adapter_options = wgpu::RequestAdapterOptions { + let adapter_options = wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::from_env() .unwrap_or(wgpu::PowerPreference::HighPerformance), compatible_surface: compatible_surface.as_ref(),