diff options
author | 2025-02-21 19:21:10 +0100 | |
---|---|---|
committer | 2025-02-21 19:21:10 +0100 | |
commit | f1ed99cb47997e1d194a41e7cdf2846f8eb5f8fa (patch) | |
tree | b2eeb7537ffd49bfbdd24c1a9580870eca99caa6 /core/src | |
parent | 81ca3d2a223d62fbb48b93dcea5409f6212605fa (diff) | |
parent | 800a73ddd7d4a2e0b1ed23ec565cbc6325b3b7f0 (diff) | |
download | iced-f1ed99cb47997e1d194a41e7cdf2846f8eb5f8fa.tar.gz iced-f1ed99cb47997e1d194a41e7cdf2846f8eb5f8fa.tar.bz2 iced-f1ed99cb47997e1d194a41e7cdf2846f8eb5f8fa.zip |
Merge pull request #2809 from iced-rs/rust-2024
Update to Rust 2024
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/background.rs | 2 | ||||
-rw-r--r-- | core/src/color.rs | 8 | ||||
-rw-r--r-- | core/src/keyboard/event.rs | 2 | ||||
-rw-r--r-- | core/src/keyboard/key.rs | 4 | ||||
-rw-r--r-- | core/src/shell.rs | 2 | ||||
-rw-r--r-- | core/src/theme/palette.rs | 2 | ||||
-rw-r--r-- | core/src/widget/operation/focusable.rs | 4 | ||||
-rw-r--r-- | core/src/widget/operation/text_input.rs | 4 | ||||
-rw-r--r-- | core/src/widget/text.rs | 2 | ||||
-rw-r--r-- | core/src/window/settings.rs | 2 |
10 files changed, 14 insertions, 18 deletions
diff --git a/core/src/background.rs b/core/src/background.rs index c8b7cbea..1f665ef4 100644 --- a/core/src/background.rs +++ b/core/src/background.rs @@ -1,5 +1,5 @@ -use crate::gradient::{self, Gradient}; use crate::Color; +use crate::gradient::{self, Gradient}; /// The background of some element. #[derive(Debug, Clone, Copy, PartialEq)] diff --git a/core/src/color.rs b/core/src/color.rs index a2e076ae..a9183776 100644 --- a/core/src/color.rs +++ b/core/src/color.rs @@ -227,12 +227,8 @@ macro_rules! color { ($r:expr, $g:expr, $b:expr) => { $crate::Color::from_rgb8($r, $g, $b) }; - ($r:expr, $g:expr, $b:expr, $a:expr) => {{ - $crate::Color::from_rgba8($r, $g, $b, $a) - }}; - ($hex:expr) => {{ - $crate::color!($hex, 1.0) - }}; + ($r:expr, $g:expr, $b:expr, $a:expr) => {{ $crate::Color::from_rgba8($r, $g, $b, $a) }}; + ($hex:expr) => {{ $crate::color!($hex, 1.0) }}; ($hex:expr, $a:expr) => {{ let hex = $hex as u32; diff --git a/core/src/keyboard/event.rs b/core/src/keyboard/event.rs index 6e483f5b..88c57b21 100644 --- a/core/src/keyboard/event.rs +++ b/core/src/keyboard/event.rs @@ -1,6 +1,6 @@ +use crate::SmolStr; use crate::keyboard::key; use crate::keyboard::{Key, Location, Modifiers}; -use crate::SmolStr; /// A keyboard event. /// diff --git a/core/src/keyboard/key.rs b/core/src/keyboard/key.rs index 47169d9a..8edb280c 100644 --- a/core/src/keyboard/key.rs +++ b/core/src/keyboard/key.rs @@ -1252,7 +1252,7 @@ impl PartialEq<Code> for Physical { #[inline] fn eq(&self, rhs: &Code) -> bool { match self { - Physical::Code(ref code) => code == rhs, + Physical::Code(code) => code == rhs, Physical::Unidentified(_) => false, } } @@ -1269,7 +1269,7 @@ impl PartialEq<NativeCode> for Physical { #[inline] fn eq(&self, rhs: &NativeCode) -> bool { match self { - Physical::Unidentified(ref code) => code == rhs, + Physical::Unidentified(code) => code == rhs, Physical::Code(_) => false, } } diff --git a/core/src/shell.rs b/core/src/shell.rs index 56250e2e..e3fcdf89 100644 --- a/core/src/shell.rs +++ b/core/src/shell.rs @@ -1,6 +1,6 @@ +use crate::InputMethod; use crate::event; use crate::window; -use crate::InputMethod; /// A connection to the state of a shell. /// diff --git a/core/src/theme/palette.rs b/core/src/theme/palette.rs index b69f99b1..b4acaa83 100644 --- a/core/src/theme/palette.rs +++ b/core/src/theme/palette.rs @@ -1,5 +1,5 @@ //! Define the colors of a theme. -use crate::{color, Color}; +use crate::{Color, color}; use palette::color_difference::Wcag21RelativeContrast; use palette::rgb::Rgb; diff --git a/core/src/widget/operation/focusable.rs b/core/src/widget/operation/focusable.rs index a1327bc1..1ee41244 100644 --- a/core/src/widget/operation/focusable.rs +++ b/core/src/widget/operation/focusable.rs @@ -1,7 +1,7 @@ //! Operate on widgets that can be focused. -use crate::widget::operation::{self, Operation, Outcome}; -use crate::widget::Id; use crate::Rectangle; +use crate::widget::Id; +use crate::widget::operation::{self, Operation, Outcome}; /// The internal state of a widget that can be focused. pub trait Focusable { diff --git a/core/src/widget/operation/text_input.rs b/core/src/widget/operation/text_input.rs index a46f1a2d..efb2a4d3 100644 --- a/core/src/widget/operation/text_input.rs +++ b/core/src/widget/operation/text_input.rs @@ -1,7 +1,7 @@ //! Operate on widgets that have text input. -use crate::widget::operation::Operation; -use crate::widget::Id; use crate::Rectangle; +use crate::widget::Id; +use crate::widget::operation::Operation; /// The internal state of a widget that has text input. pub trait TextInput { diff --git a/core/src/widget/text.rs b/core/src/widget/text.rs index c7ec3c8b..9a00fcdb 100644 --- a/core/src/widget/text.rs +++ b/core/src/widget/text.rs @@ -304,7 +304,7 @@ where let size = size.unwrap_or_else(|| renderer.default_size()); let font = font.unwrap_or_else(|| renderer.default_font()); - let State(ref mut paragraph) = state; + let State(paragraph) = state; paragraph.update(text::Text { content, diff --git a/core/src/window/settings.rs b/core/src/window/settings.rs index 9432eaaa..94bcfd78 100644 --- a/core/src/window/settings.rs +++ b/core/src/window/settings.rs @@ -24,8 +24,8 @@ mod platform; #[path = "settings/other.rs"] mod platform; -use crate::window::{Icon, Level, Position}; use crate::Size; +use crate::window::{Icon, Level, Position}; pub use platform::PlatformSpecific; |