@@ -16,7 +16,7 @@ use async_trait::async_trait;
1616use futures_util:: { Stream , StreamExt , stream as futures_stream} ;
1717use http:: Method ;
1818
19- use crate :: s3:: multimap:: Multimap ;
19+ use crate :: s3:: multimap:: { Multimap , MultimapExt } ;
2020use crate :: s3:: utils:: insert;
2121use crate :: s3:: {
2222 client:: Client ,
@@ -36,11 +36,11 @@ fn add_common_list_objects_query_params(
3636 max_keys : Option < u16 > ,
3737 prefix : Option < String > ,
3838) {
39- query_params. insert ( "delimiter" . into ( ) , delimiter. unwrap_or ( "" . into ( ) ) ) ;
40- query_params. insert ( "max-keys" . into ( ) , max_keys. unwrap_or ( 1000 ) . to_string ( ) ) ;
41- query_params. insert ( "prefix" . into ( ) , prefix. unwrap_or ( "" . into ( ) ) ) ;
39+ query_params. add ( "delimiter" , delimiter. unwrap_or ( "" . into ( ) ) ) ;
40+ query_params. add ( "max-keys" , max_keys. unwrap_or ( 1000 ) . to_string ( ) ) ;
41+ query_params. add ( "prefix" , prefix. unwrap_or ( "" . into ( ) ) ) ;
4242 if !disable_url_encoding {
43- query_params. insert ( "encoding-type" . into ( ) , "url" . into ( ) ) ;
43+ query_params. add ( "encoding-type" , "url" ) ;
4444 }
4545}
4646
@@ -125,7 +125,7 @@ impl ToS3Request for ListObjectsV1 {
125125 self . prefix ,
126126 ) ;
127127 if let Some ( v) = self . marker {
128- query_params. insert ( "marker" . into ( ) , v) ;
128+ query_params. add ( "marker" , v) ;
129129 }
130130 }
131131
@@ -221,7 +221,7 @@ impl ToS3Request for ListObjectsV2 {
221221
222222 let mut query_params: Multimap = self . extra_query_params . unwrap_or_default ( ) ;
223223 {
224- query_params. insert ( "list-type" . into ( ) , "2" . into ( ) ) ;
224+ query_params. add ( "list-type" , "2" ) ;
225225 add_common_list_objects_query_params (
226226 & mut query_params,
227227 self . delimiter ,
@@ -230,19 +230,19 @@ impl ToS3Request for ListObjectsV2 {
230230 self . prefix ,
231231 ) ;
232232 if let Some ( v) = self . continuation_token {
233- query_params. insert ( "continuation-token" . into ( ) , v) ;
233+ query_params. add ( "continuation-token" , v) ;
234234 }
235235 if self . fetch_owner {
236- query_params. insert ( "fetch-owner" . into ( ) , "true" . into ( ) ) ;
236+ query_params. add ( "fetch-owner" , "true" ) ;
237237 }
238238 if let Some ( v) = self . start_after {
239- query_params. insert ( "start-after" . into ( ) , v) ;
239+ query_params. add ( "start-after" , v) ;
240240 }
241241 if self . include_user_metadata {
242- query_params. insert ( "metadata" . into ( ) , "true" . into ( ) ) ;
242+ query_params. add ( "metadata" , "true" ) ;
243243 }
244244 if self . unsorted {
245- query_params. insert ( "unsorted" . into ( ) , "true" . into ( ) ) ;
245+ query_params. add ( "unsorted" , "true" ) ;
246246 }
247247 }
248248
@@ -353,16 +353,16 @@ impl ToS3Request for ListObjectVersions {
353353 self . prefix ,
354354 ) ;
355355 if let Some ( v) = self . key_marker {
356- query_params. insert ( "key-marker" . into ( ) , v) ;
356+ query_params. add ( "key-marker" , v) ;
357357 }
358358 if let Some ( v) = self . version_id_marker {
359- query_params. insert ( "version-id-marker" . into ( ) , v) ;
359+ query_params. add ( "version-id-marker" , v) ;
360360 }
361361 if self . include_user_metadata {
362- query_params. insert ( "metadata" . into ( ) , "true" . into ( ) ) ;
362+ query_params. add ( "metadata" , "true" ) ;
363363 }
364364 if self . unsorted {
365- query_params. insert ( "unsorted" . into ( ) , "true" . into ( ) ) ;
365+ query_params. add ( "unsorted" , "true" ) ;
366366 }
367367 }
368368
0 commit comments