You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2026/04/16 23:47:59 UTC

(opendal) branch xuanwo/fix-rust-1-95-clippy created (now 25812b669)

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

xuanwo pushed a change to branch xuanwo/fix-rust-1-95-clippy
in repository https://gitbox.apache.org/repos/asf/opendal.git


      at 25812b669 fix: address clippy lints on Rust 1.95

This branch includes the following new commits:

     new 25812b669 fix: address clippy lints on Rust 1.95

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: fix: address clippy lints on Rust 1.95

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

xuanwo pushed a commit to branch xuanwo/fix-rust-1-95-clippy
in repository https://gitbox.apache.org/repos/asf/opendal.git

commit 25812b6691afe3836a97a2e39d842cd424c0aea9
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Fri Apr 17 07:47:44 2026 +0800

    fix: address clippy lints on Rust 1.95
---
 core/core/src/types/read/reader.rs     |  2 +-
 core/services/webdav/src/core.rs       | 44 +++++++++++++++-------------------
 integrations/object_store/src/store.rs |  2 +-
 3 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/core/core/src/types/read/reader.rs b/core/core/src/types/read/reader.rs
index 576a0390b..a2af93390 100644
--- a/core/core/src/types/read/reader.rs
+++ b/core/core/src/types/read/reader.rs
@@ -194,7 +194,7 @@ impl Reader {
         let gap = self.ctx.options().gap().unwrap_or(1024 * 1024) as u64;
         // We don't care about the order of range with same start, they
         // will be merged in the next step.
-        ranges.sort_unstable_by(|a, b| a.start.cmp(&b.start));
+        ranges.sort_unstable_by_key(|a| a.start);
 
         // We know that this vector will have at most element
         let mut merged = Vec::with_capacity(ranges.len());
diff --git a/core/services/webdav/src/core.rs b/core/services/webdav/src/core.rs
index 57a52dcba..c3d66209d 100644
--- a/core/services/webdav/src/core.rs
+++ b/core/services/webdav/src/core.rs
@@ -609,27 +609,23 @@ pub fn parse_user_metadata_from_xml(xml: &str, namespace_uri: &str) -> HashMap<S
                     }
                 }
             }
-            Ok(Event::Text(ref e)) => {
-                if current_prop_key.is_some() {
-                    // Text content - add directly (no escaping needed)
-                    let text_str = String::from_utf8_lossy(e.as_ref());
-                    current_prop_value.push_str(&text_str);
-                }
+            Ok(Event::Text(ref e)) if current_prop_key.is_some() => {
+                // Text content - add directly (no escaping needed)
+                let text_str = String::from_utf8_lossy(e.as_ref());
+                current_prop_value.push_str(&text_str);
             }
-            Ok(Event::GeneralRef(ref e)) => {
-                if current_prop_key.is_some() {
-                    // Handle XML entity references (e.g., &lt; &gt; &amp; &quot; &apos;)
-                    let entity_name = String::from_utf8_lossy(e.as_ref());
-                    let decoded = match entity_name.as_ref() {
-                        "lt" => "<",
-                        "gt" => ">",
-                        "amp" => "&",
-                        "quot" => "\"",
-                        "apos" => "'",
-                        _ => "", // Unknown entity, skip
-                    };
-                    current_prop_value.push_str(decoded);
-                }
+            Ok(Event::GeneralRef(ref e)) if current_prop_key.is_some() => {
+                // Handle XML entity references (e.g., &lt; &gt; &amp; &quot; &apos;)
+                let entity_name = String::from_utf8_lossy(e.as_ref());
+                let decoded = match entity_name.as_ref() {
+                    "lt" => "<",
+                    "gt" => ">",
+                    "amp" => "&",
+                    "quot" => "\"",
+                    "apos" => "'",
+                    _ => "", // Unknown entity, skip
+                };
+                current_prop_value.push_str(decoded);
             }
             Ok(Event::End(ref e)) => {
                 let name = String::from_utf8_lossy(e.name().as_ref()).to_string();
@@ -682,11 +678,9 @@ pub fn check_proppatch_response(xml: &str) -> Result<()> {
                     status_text.clear();
                 }
             }
-            Ok(Event::Text(ref e)) => {
-                if in_status {
-                    let text_str = String::from_utf8_lossy(e.as_ref());
-                    status_text.push_str(&text_str);
-                }
+            Ok(Event::Text(ref e)) if in_status => {
+                let text_str = String::from_utf8_lossy(e.as_ref());
+                status_text.push_str(&text_str);
             }
             Ok(Event::End(ref e)) => {
                 let name = String::from_utf8_lossy(e.name().as_ref()).to_lowercase();
diff --git a/integrations/object_store/src/store.rs b/integrations/object_store/src/store.rs
index 269e9cb3f..e9a5bbf77 100644
--- a/integrations/object_store/src/store.rs
+++ b/integrations/object_store/src/store.rs
@@ -662,7 +662,7 @@ impl MultipartUpload for OpendalMultipartUpload {
 
             let mut writer = writer.lock().await;
             let result = writer
-                .write(Buffer::from_iter(data.into_iter()))
+                .write(Buffer::from_iter(data))
                 .await
                 .map_err(|err| format_object_store_error(err, location.as_ref()));