diff options
author | 2025-02-21 01:19:53 +0100 | |
---|---|---|
committer | 2025-02-21 01:37:13 +0100 | |
commit | 67e489e382e98fc5d101b7892f1c7e44563d60f5 (patch) | |
tree | 17021855ef0bcd76eb6cfbfadf0a82f89c7b5568 | |
parent | 81ca3d2a223d62fbb48b93dcea5409f6212605fa (diff) | |
download | iced-67e489e382e98fc5d101b7892f1c7e44563d60f5.tar.gz iced-67e489e382e98fc5d101b7892f1c7e44563d60f5.tar.bz2 iced-67e489e382e98fc5d101b7892f1c7e44563d60f5.zip |
Update to Rust 2024 and fix compiler errors
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | core/src/keyboard/key.rs | 4 | ||||
-rw-r--r-- | core/src/widget/text.rs | 2 | ||||
-rw-r--r-- | test/src/lib.rs | 6 | ||||
-rw-r--r-- | widget/src/pane_grid.rs | 4 | ||||
-rw-r--r-- | widget/src/vertical_slider.rs | 6 |
6 files changed, 13 insertions, 13 deletions
@@ -122,13 +122,13 @@ members = [ [workspace.package] version = "0.14.0-dev" authors = ["Héctor Ramón Jiménez <hector@hecrj.dev>"] -edition = "2021" +edition = "2024" license = "MIT" repository = "https://github.com/iced-rs/iced" homepage = "https://iced.rs" categories = ["gui"] keywords = ["gui", "ui", "graphics", "interface", "widgets"] -rust-version = "1.82" +rust-version = "1.85" [workspace.dependencies] iced = { version = "0.14.0-dev", path = "." } 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/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/test/src/lib.rs b/test/src/lib.rs index 73726f08..982cc2c1 100644 --- a/test/src/lib.rs +++ b/test/src/lib.rs @@ -105,8 +105,8 @@ use crate::core::window; use crate::core::{ Element, Event, Font, Point, Rectangle, Settings, Size, SmolStr, }; -use crate::runtime::user_interface; use crate::runtime::UserInterface; +use crate::runtime::user_interface; use std::borrow::Cow; use std::fs; @@ -459,7 +459,9 @@ where } /// Turns the [`Simulator`] into the sequence of messages produced by any interactions. - pub fn into_messages(self) -> impl Iterator<Item = Message> { + pub fn into_messages( + self, + ) -> impl Iterator<Item = Message> + use<Message, Theme, Renderer> { self.messages.into_iter() } } diff --git a/widget/src/pane_grid.rs b/widget/src/pane_grid.rs index 3ae1dfc7..c0ff97fc 100644 --- a/widget/src/pane_grid.rs +++ b/widget/src/pane_grid.rs @@ -688,10 +688,10 @@ where .iter() .zip(&self.contents) .zip(layout.children()) - .filter(|((&pane, _content), _layout)| { + .filter(|((pane, _content), _layout)| { self.internal .maximized() - .map_or(true, |maximized| pane == maximized) + .map_or(true, |maximized| **pane == maximized) }) .find_map(|((_pane, content), layout)| { content.grid_interaction( diff --git a/widget/src/vertical_slider.rs b/widget/src/vertical_slider.rs index 6f878fde..436c2345 100644 --- a/widget/src/vertical_slider.rs +++ b/widget/src/vertical_slider.rs @@ -31,7 +31,7 @@ use std::ops::RangeInclusive; pub use crate::slider::{ - default, Catalog, Handle, HandleShape, Status, Style, StyleFn, + Catalog, Handle, HandleShape, Status, Style, StyleFn, default, }; use crate::core::border::Border; @@ -393,9 +393,7 @@ where shell.capture_event(); } } - Event::Keyboard(keyboard::Event::KeyPressed { - ref key, .. - }) => { + Event::Keyboard(keyboard::Event::KeyPressed { key, .. }) => { if cursor.is_over(layout.bounds()) { match key { Key::Named(key::Named::ArrowUp) => { |