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

(opendal) branch fix/onedrive-api-alignment updated: fix(ci): address rust 1.95 clippy lints

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

suyanhanx pushed a commit to branch fix/onedrive-api-alignment
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/fix/onedrive-api-alignment by this push:
     new dcfdcf1aa fix(ci): address rust 1.95 clippy lints
dcfdcf1aa is described below

commit dcfdcf1aa0755962c7529d8e1986f671f8506131
Author: suyanhanx <su...@gmail.com>
AuthorDate: Thu Apr 16 23:29:13 2026 +0800

    fix(ci): address rust 1.95 clippy lints
---
 core/services/webdav/src/core.rs       | 44 +++++++++++++++-------------------
 dev/src/generate/python.rs             |  8 +++----
 integrations/object_store/src/store.rs |  2 +-
 3 files changed, 23 insertions(+), 31 deletions(-)

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/dev/src/generate/python.rs b/dev/src/generate/python.rs
index 5eda8b581..ae7a61142 100644
--- a/dev/src/generate/python.rs
+++ b/dev/src/generate/python.rs
@@ -121,12 +121,10 @@ pub fn format_text(text: &str, indent: usize, max_line_length: usize) -> String
 
     for (i, &ch) in chars.iter().enumerate() {
         match ch {
-            '.' | '!' | '?' => {
+            '.' | '!' | '?' if i + 1 < chars.len() && chars[i + 1].is_whitespace() => {
                 // Sentence end
-                if i + 1 < chars.len() && chars[i + 1].is_whitespace() {
-                    segments.push(&text[start..=i]);
-                    start = i + 1;
-                }
+                segments.push(&text[start..=i]);
+                start = i + 1;
             }
             '\n' => {
                 if i > start {
diff --git a/integrations/object_store/src/store.rs b/integrations/object_store/src/store.rs
index a0e6356ed..32f2b2025 100644
--- a/integrations/object_store/src/store.rs
+++ b/integrations/object_store/src/store.rs
@@ -656,7 +656,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()));