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 f326849f7 chore(services/azfile): Use QueryPairsWriter for url write 
(#5993)
f326849f7 is described below

commit f326849f72a8af3b977bf83c1fca24ed7d90d376
Author: Asuka Minato <[email protected]>
AuthorDate: Wed Apr 9 18:53:34 2025 +0900

    chore(services/azfile): Use QueryPairsWriter for url write (#5993)
    
    QueryPairsWriter
---
 core/src/services/azfile/core.rs | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/core/src/services/azfile/core.rs b/core/src/services/azfile/core.rs
index 48f3640fa..8883cd7d8 100644
--- a/core/src/services/azfile/core.rs
+++ b/core/src/services/azfile/core.rs
@@ -344,22 +344,27 @@ impl AzfileCore {
             .trim_start_matches('/')
             .to_string();
 
-        let mut url = format!(
-            "{}/{}/{}?restype=directory&comp=list&include=Timestamps,ETag",
+        let url = format!(
+            "{}/{}/{}",
             self.endpoint,
             self.share_name,
             percent_encode_path(&p),
         );
 
+        let mut url = QueryPairsWriter::new(&url)
+            .push("restype", "directory")
+            .push("comp", "list")
+            .push("include", "Timestamps,ETag");
+
         if !continuation.is_empty() {
-            write!(url, "&marker={}", &continuation).expect("write into string 
must succeed");
+            url = url.push("marker", &continuation);
         }
 
         if let Some(limit) = limit {
-            write!(url, "&maxresults={}", limit).expect("write into string 
must succeed");
+            url = url.push("maxresults", &limit.to_string());
         }
 
-        let req = Request::get(&url);
+        let req = Request::get(url.finish());
 
         let mut req = 
req.body(Buffer::new()).map_err(new_request_build_error)?;
         self.sign(&mut req).await?;

Reply via email to