Skip to content

Commit 9d7943d

Browse files
chore: apply suggestions from clippy 1.91.0 (#6754)
* chore: apply suggestions from clippy 1.91.0 * add -A clippy::incompatible_msrv to allow the clippy warning tmply --------- Co-authored-by: koushiro <koushiro.cqx@gmail.com>
1 parent 1999b64 commit 9d7943d

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

bindings/python/justfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ test *args: install-dev
114114
[group('lint')]
115115
lint: setup
116116
@echo "{{ BOLD }}--- Running Rust linter (Clippy) ---{{ NORMAL }}"
117-
@cargo clippy -- -D warnings -D clippy::dbg_macro
117+
## remove `-A clippy::incompatible_msrv` until https://github.com/rust-lang/rust-clippy/issues/15792 is fixed and released
118+
@cargo clippy -- -D warnings -D clippy::dbg_macro -A clippy::incompatible_msrv
118119
@echo "{{ BOLD }}--- Running Python linter (Ruff) ---{{ NORMAL }}"
119120
@uv run ruff check
120121

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)