You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by ki...@apache.org on 2025/11/04 09:40:38 UTC

(opendal) branch chore-clippy-1 created (now 233ca540c)

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

kingsword09 pushed a change to branch chore-clippy-1
in repository https://gitbox.apache.org/repos/asf/opendal.git


      at 233ca540c chore: apply suggestions from clippy 1.91.0

This branch includes the following new commits:

     new 233ca540c chore: apply suggestions from clippy 1.91.0

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(opendal) 01/01: chore: apply suggestions from clippy 1.91.0

Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kingsword09 pushed a commit to branch chore-clippy-1
in repository https://gitbox.apache.org/repos/asf/opendal.git

commit 233ca540cbbb5f5bc6f889006bd9b11d60c4e409
Author: Kingsword <ki...@gmail.com>
AuthorDate: Tue Nov 4 17:40:25 2025 +0800

    chore: apply suggestions from clippy 1.91.0
---
 core/src/types/mode.rs   | 9 ++-------
 core/src/types/scheme.rs | 9 ++-------
 2 files changed, 4 insertions(+), 14 deletions(-)

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())