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 b475855b2 chore(service/azdls): use QueryPairsWriter for url write 
(#5988)
b475855b2 is described below

commit b475855b2262cef5dc8e9e4976107379fcd6a1b6
Author: Keming <[email protected]>
AuthorDate: Tue Apr 8 21:03:19 2025 +0800

    chore(service/azdls): use QueryPairsWriter for url write (#5988)
    
    only change the query pair writer part
    
    Signed-off-by: Keming <[email protected]>
---
 core/src/services/azdls/core.rs | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/core/src/services/azdls/core.rs b/core/src/services/azdls/core.rs
index fd123a0d4..165d3b5a7 100644
--- a/core/src/services/azdls/core.rs
+++ b/core/src/services/azdls/core.rs
@@ -28,7 +28,6 @@ use reqsign::AzureStorageSigner;
 use std::fmt;
 use std::fmt::Debug;
 use std::fmt::Formatter;
-use std::fmt::Write;
 use std::sync::Arc;
 
 use crate::raw::*;
@@ -273,23 +272,20 @@ impl AzdlsCore {
             .trim_end_matches('/')
             .to_string();
 
-        let mut url = format!(
-            "{}/{}?resource=filesystem&recursive=false",
-            self.endpoint, self.filesystem
-        );
+        let mut url = QueryPairsWriter::new(&format!("{}/{}", self.endpoint, 
self.filesystem))
+            .push("resource", "filesystem")
+            .push("recursive", "false");
         if !p.is_empty() {
-            write!(url, "&directory={}", percent_encode_path(&p))
-                .expect("write into string must succeed");
+            url = url.push("directory", &percent_encode_path(&p));
         }
         if let Some(limit) = limit {
-            write!(url, "&maxResults={limit}").expect("write into string must 
succeed");
+            url = url.push("maxResults", &limit.to_string());
         }
         if !continuation.is_empty() {
-            write!(url, "&continuation={}", percent_encode_path(continuation))
-                .expect("write into string must succeed");
+            url = url.push("continuation", &percent_encode_path(continuation));
         }
 
-        let mut req = Request::get(&url)
+        let mut req = Request::get(url.finish())
             .body(Buffer::new())
             .map_err(new_request_build_error)?;
 

Reply via email to