diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-10 16:52:19 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-10 16:52:19 +0800 |
| commit | 02e07a18fcb3af9319c271f6e41d5b7785e2e436 (patch) | |
| tree | ff76916c254e87a7aadc5cb4dfd2134eaf4f03fc /arg_picker/src/value/flag.rs | |
| parent | 03b487f0f93ac32835149d4c1a0fb420341134f8 (diff) | |
style: satisfy clippy pedantic and nursery lints
Diffstat (limited to 'arg_picker/src/value/flag.rs')
| -rw-r--r-- | arg_picker/src/value/flag.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arg_picker/src/value/flag.rs b/arg_picker/src/value/flag.rs index c0673bd..6449d65 100644 --- a/arg_picker/src/value/flag.rs +++ b/arg_picker/src/value/flag.rs @@ -80,9 +80,9 @@ impl Flag { /// [`Active`]: Flag::Active /// [`Inactive`]: Flag::Inactive #[must_use] - #[inline(always)] + #[inline] pub fn bool(&self) -> bool { - *self == Flag::Active + *self == Self::Active } } @@ -101,7 +101,7 @@ impl PartialEq<Flag> for bool { impl From<bool> for Flag { fn from(value: bool) -> Self { - if value { Flag::Active } else { Flag::Inactive } + if value { Self::Active } else { Self::Inactive } } } @@ -127,19 +127,19 @@ impl Deref for Flag { fn deref(&self) -> &bool { match self { - Flag::Active => &true, - Flag::Inactive => &false, + Self::Active => &true, + Self::Inactive => &false, } } } impl Not for Flag { - type Output = Flag; + type Output = Self; - fn not(self) -> Flag { + fn not(self) -> Self { match self { - Flag::Active => Flag::Inactive, - Flag::Inactive => Flag::Active, + Self::Active => Self::Inactive, + Self::Inactive => Self::Active, } } } |
