This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 9d7943d86 chore: apply suggestions from clippy 1.91.0 (#6754)
9d7943d86 is described below

commit 9d7943d868635e334a085f5b2f50179a007800fa
Author: Kingsword <[email protected]>
AuthorDate: Wed Nov 5 00:47:36 2025 +0800

    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 <[email protected]>
---
 bindings/python/justfile | 3 ++-
 core/src/types/mode.rs   | 9 ++-------
 core/src/types/scheme.rs | 9 ++-------
 3 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/bindings/python/justfile b/bindings/python/justfile
index fdca9af5b..6181a1ea6 100644
--- a/bindings/python/justfile
+++ b/bindings/python/justfile
@@ -114,7 +114,8 @@ test *args: install-dev
 [group('lint')]
 lint: setup
     @echo "{{ BOLD }}--- Running Rust linter (Clippy) ---{{ NORMAL }}"
-    @cargo clippy -- -D warnings -D clippy::dbg_macro
+    ## remove `-A clippy::incompatible_msrv` until 
https://github.com/rust-lang/rust-clippy/issues/15792 is fixed and released
+    @cargo clippy -- -D warnings -D clippy::dbg_macro -A 
clippy::incompatible_msrv
     @echo "{{ BOLD }}--- Running Python linter (Ruff) ---{{ NORMAL }}"
     @uv run ruff check
 
diff --git a/core/src/types/mode.rs b/core/src/types/mode.rs
index aa8b8d350..bbb464c75 100644
--- a/core/src/types/mode.rs
+++ b/core/src/types/mode.rs
@@ -19,13 +19,14 @@ use std::fmt::Display;
 use std::fmt::Formatter;
 
 /// EntryMode represents the mode.
-#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+#[derive(Copy, Clone, Debug, Eq, PartialEq, Default)]
 pub enum EntryMode {
     /// FILE means the path has data to read.
     FILE,
     /// DIR means the path can be listed.
     DIR,
     /// Unknown means we don't know what we can do on this path.
+    #[default]
     Unknown,
 }
 
@@ -51,12 +52,6 @@ impl EntryMode {
     }
 }
 
-impl Default for EntryMode {
-    fn default() -> Self {
-        Self::Unknown
-    }
-}
-
 impl Display for EntryMode {
     fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
         match self {
diff --git a/core/src/types/scheme.rs b/core/src/types/scheme.rs
index c08622506..ba56fddf8 100644
--- a/core/src/types/scheme.rs
+++ b/core/src/types/scheme.rs
@@ -29,7 +29,7 @@ use crate::Error;
 /// - Scheme is `non_exhaustive`, new variant COULD be added at any time.
 /// - New variant SHOULD be added in alphabet orders,
 /// - Users MUST NOT relay on its order.
-#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Default)]
 #[non_exhaustive]
 pub enum Scheme {
     /// [aliyun-drive][crate::services::AliyunDrive]: Aliyun Drive services.
@@ -98,6 +98,7 @@ pub enum Scheme {
     /// [memcached][crate::services::Memcached]: Memcached service support.
     Memcached,
     /// [memory][crate::services::Memory]: In memory backend support.
+    #[default]
     Memory,
     /// [mini-moka][crate::services::MiniMoka]: Mini Moka backend support.
     MiniMoka,
@@ -309,12 +310,6 @@ impl Scheme {
     }
 }
 
-impl Default for Scheme {
-    fn default() -> Self {
-        Self::Memory
-    }
-}
-
 impl Display for Scheme {
     fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
         write!(f, "{}", self.into_static())

Reply via email to