diff options
author | 2023-03-14 11:11:17 +0100 | |
---|---|---|
committer | 2023-03-14 11:11:17 +0100 | |
commit | 1816c985fad2ead8dc1e7b62dc8e4bafeed856b2 (patch) | |
tree | 09fc36e95e99939842cf14c79d4a08baf9a2da1f /core | |
parent | 8f14b448d263a2cfd03a998b1d54c21e33d58980 (diff) | |
download | iced-1816c985fad2ead8dc1e7b62dc8e4bafeed856b2.tar.gz iced-1816c985fad2ead8dc1e7b62dc8e4bafeed856b2.tar.bz2 iced-1816c985fad2ead8dc1e7b62dc8e4bafeed856b2.zip |
Fix `clippy` lints for Rust 1.68
Diffstat (limited to 'core')
-rw-r--r-- | core/src/font.rs | 9 | ||||
-rw-r--r-- | core/src/mouse/interaction.rs | 9 |
2 files changed, 4 insertions, 14 deletions
diff --git a/core/src/font.rs b/core/src/font.rs index 3f9ad2b5..d8c34e5a 100644 --- a/core/src/font.rs +++ b/core/src/font.rs @@ -1,10 +1,11 @@ /// A font. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, Default)] pub enum Font { /// The default font. /// /// This is normally a font configured in a renderer or loaded from the /// system. + #[default] Default, /// An external font. @@ -16,9 +17,3 @@ pub enum Font { bytes: &'static [u8], }, } - -impl Default for Font { - fn default() -> Font { - Font::Default - } -} diff --git a/core/src/mouse/interaction.rs b/core/src/mouse/interaction.rs index 664147a7..57da93fe 100644 --- a/core/src/mouse/interaction.rs +++ b/core/src/mouse/interaction.rs @@ -1,7 +1,8 @@ /// The interaction of a mouse cursor. -#[derive(Debug, Eq, PartialEq, Clone, Copy, PartialOrd, Ord)] +#[derive(Debug, Eq, PartialEq, Clone, Copy, PartialOrd, Ord, Default)] #[allow(missing_docs)] pub enum Interaction { + #[default] Idle, Pointer, Grab, @@ -12,9 +13,3 @@ pub enum Interaction { ResizingHorizontally, ResizingVertically, } - -impl Default for Interaction { - fn default() -> Interaction { - Interaction::Idle - } -} |