fix clippy

This commit is contained in:
Evan Almloff committed 2023-03-12 15:13:34 -05:00
1 parent eee6cbabb2
commit fda125de5f
3 files changed
+6 -21

No files matched your search

+2 -7
View File
@@ -46,18 +46,13 @@ impl Default for Config {
} }
} }
#[derive(Clone, Copy)] #[derive(Clone, Copy, Default)]
pub enum RenderingMode { pub enum RenderingMode {
/// only 16 colors by accessed by name, no alpha support /// only 16 colors by accessed by name, no alpha support
BaseColors, BaseColors,
/// 8 bit colors, will be downsampled from rgb colors /// 8 bit colors, will be downsampled from rgb colors
Ansi, Ansi,
/// 24 bit colors, most terminals support this /// 24 bit colors, most terminals support this
#[default]
Rgb, Rgb,
} }
impl Default for RenderingMode {
fn default() -> Self {
RenderingMode::Rgb
}
}
+2 -7
View File
@@ -14,8 +14,9 @@ use dioxus_native_core::{
state::NodeDepState, state::NodeDepState,
}; };
#[derive(Clone, Copy, PartialEq, Eq, Debug)] #[derive(Clone, Copy, PartialEq, Eq, Debug, Default)]
pub(crate) enum FocusLevel { pub(crate) enum FocusLevel {
#[default]
Unfocusable, Unfocusable,
Focusable, Focusable,
Ordered(std::num::NonZeroU16), Ordered(std::num::NonZeroU16),
@@ -53,12 +54,6 @@ impl Ord for FocusLevel {
} }
} }
impl Default for FocusLevel {
fn default() -> Self {
FocusLevel::Unfocusable
}
}
#[derive(Clone, PartialEq, Debug, Default)] #[derive(Clone, PartialEq, Debug, Default)]
pub(crate) struct Focus { pub(crate) struct Focus {
pub level: FocusLevel, pub level: FocusLevel,
+2 -7
View File
@@ -20,7 +20,7 @@ pub(crate) struct NodeState {
pub focused: bool, pub focused: bool,
} }
#[derive(PartialEq, Debug, Clone)] #[derive(PartialEq, Debug, Clone, Default)]
pub(crate) enum PreventDefault { pub(crate) enum PreventDefault {
Focus, Focus,
KeyPress, KeyPress,
@@ -32,6 +32,7 @@ pub(crate) enum PreventDefault {
MouseEnter, MouseEnter,
MouseLeave, MouseLeave,
MouseOut, MouseOut,
#[default]
Unknown, Unknown,
MouseOver, MouseOver,
ContextMenu, ContextMenu,
@@ -39,12 +40,6 @@ pub(crate) enum PreventDefault {
MouseUp, MouseUp,
} }
impl Default for PreventDefault {
fn default() -> Self {
PreventDefault::Unknown
}
}
impl NodeDepState for PreventDefault { impl NodeDepState for PreventDefault {
type DepState = (); type DepState = ();
type Ctx = (); type Ctx = ();