Skip to content

Commit 233ca54

Browse files
committed
chore: apply suggestions from clippy 1.91.0
1 parent 1999b64 commit 233ca54

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

core/src/types/mode.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ use std::fmt::Display;
1919
use std::fmt::Formatter;
2020

2121
/// EntryMode represents the mode.
22-
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
22+
#[derive(Copy, Clone, Debug, Eq, PartialEq, Default)]
2323
pub enum EntryMode {
2424
/// FILE means the path has data to read.
2525
FILE,
2626
/// DIR means the path can be listed.
2727
DIR,
2828
/// Unknown means we don't know what we can do on this path.
29+
#[default]
2930
Unknown,
3031
}
3132

@@ -51,12 +52,6 @@ impl EntryMode {
5152
}
5253
}
5354

54-
impl Default for EntryMode {
55-
fn default() -> Self {
56-
Self::Unknown
57-
}
58-
}
59-
6055
impl Display for EntryMode {
6156
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
6257
match self {

core/src/types/scheme.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use crate::Error;
2929
/// - Scheme is `non_exhaustive`, new variant COULD be added at any time.
3030
/// - New variant SHOULD be added in alphabet orders,
3131
/// - Users MUST NOT relay on its order.
32-
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
32+
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Default)]
3333
#[non_exhaustive]
3434
pub enum Scheme {
3535
/// [aliyun-drive][crate::services::AliyunDrive]: Aliyun Drive services.
@@ -98,6 +98,7 @@ pub enum Scheme {
9898
/// [memcached][crate::services::Memcached]: Memcached service support.
9999
Memcached,
100100
/// [memory][crate::services::Memory]: In memory backend support.
101+
#[default]
101102
Memory,
102103
/// [mini-moka][crate::services::MiniMoka]: Mini Moka backend support.
103104
MiniMoka,
@@ -309,12 +310,6 @@ impl Scheme {
309310
}
310311
}
311312

312-
impl Default for Scheme {
313-
fn default() -> Self {
314-
Self::Memory
315-
}
316-
}
317-
318313
impl Display for Scheme {
319314
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
320315
write!(f, "{}", self.into_static())

0 commit comments

Comments
 (0)