From 8dc5c74e8b4cce27f101a0a56ef1160d2e6b05db Mon Sep 17 00:00:00 2001 From: Daniel Eades Date: Sun, 19 Nov 2023 15:13:55 +0000 Subject: [PATCH] refactor --- renderer/src/lib.rs | 4 ++-- style/src/theme.rs | 6 ------ widget/src/checkbox.rs | 1 + widget/src/scrollable.rs | 1 + widget/src/svg.rs | 1 + widget/src/toggler.rs | 1 + winit/src/application.rs | 4 +++- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/renderer/src/lib.rs b/renderer/src/lib.rs index 91b907b3bc..af4c3bd0c2 100644 --- a/renderer/src/lib.rs +++ b/renderer/src/lib.rs @@ -260,8 +260,8 @@ impl crate::graphics::geometry::Renderer for Renderer { crate::Geometry::TinySkia(primitive) => { renderer.draw_primitive(primitive); } - #[cfg(feature = "wgpu")] - crate::Geometry::Wgpu(_) => unreachable!(), + #[allow(unreachable_patterns)] + _ => unreachable!(), } } } diff --git a/style/src/theme.rs b/style/src/theme.rs index be90391353..eb0163ad6e 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -22,12 +22,6 @@ use crate::text_editor; use crate::text_input; use crate::toggler; -use ::palette::FromColor; -use ::palette::RgbHue; -use iced_core::gradient::ColorStop; -use iced_core::gradient::Linear; -use iced_core::Degrees; -use iced_core::Radians; use iced_core::{Background, Color, Vector}; use std::rc::Rc; diff --git a/widget/src/checkbox.rs b/widget/src/checkbox.rs index 323fc20290..74837d13ad 100644 --- a/widget/src/checkbox.rs +++ b/widget/src/checkbox.rs @@ -1,5 +1,6 @@ //! Show toggle controls using checkboxes. use iced_runtime::core::widget::Id; +#[cfg(feature = "a11y")] use std::borrow::Cow; use crate::core::alignment; diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index 5cf5ad9d2e..7b520476ad 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -1,5 +1,6 @@ //! Navigate an endless amount of content with a scrollbar. use iced_runtime::core::widget::Id; +#[cfg(feature = "a11y")] use std::borrow::Cow; use crate::core::event::{self, Event}; diff --git a/widget/src/svg.rs b/widget/src/svg.rs index 93d2c6ca8d..f075766804 100644 --- a/widget/src/svg.rs +++ b/widget/src/svg.rs @@ -10,6 +10,7 @@ use crate::core::{ ContentFit, Element, Layout, Length, Rectangle, Size, Vector, Widget, }; +#[cfg(feature = "a11y")] use std::borrow::Cow; use std::path::PathBuf; diff --git a/widget/src/toggler.rs b/widget/src/toggler.rs index ceaadf3a00..503f270208 100644 --- a/widget/src/toggler.rs +++ b/widget/src/toggler.rs @@ -1,4 +1,5 @@ //! Show toggle controls using togglers. +#[cfg(feature = "a11y")] use std::borrow::Cow; use crate::core::alignment; diff --git a/winit/src/application.rs b/winit/src/application.rs index 736951f789..6b8b607d2a 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -4,6 +4,7 @@ mod drag_resize; mod profiler; mod state; +#[cfg(feature = "a11y")] use iced_graphics::core::widget::operation::focusable::focus; use iced_graphics::core::widget::operation::OperationWrapper; use iced_graphics::core::widget::Operation; @@ -390,6 +391,7 @@ async fn run_instance( let mut events = Vec::new(); let mut messages = Vec::new(); let mut redraw_pending = false; + #[cfg(feature = "a11y")] let mut commands: Vec> = Vec::new(); #[cfg(feature = "a11y")] @@ -1029,7 +1031,7 @@ pub fn run_command( window::Action::GainFocus => { window.focus_window(); } - window::Action::ChangeLevel(level) => { + window::Action::ChangeLevel(_level) => { // window.set_window_level(conversion::window_level(level)); } window::Action::FetchId(tag) => {