@@ -188,9 +188,9 @@ impl FromStr for PathDescriptor {
188188
189189 // A query entry with identity must exist
190190 Ok ( PathDescriptor :: Sftp {
191- username : username. to_string ( ) ,
192- remote_address : host. to_string ( ) ,
193- remote_path : remote_path. to_string ( ) ,
191+ username : username. clone ( ) ,
192+ remote_address : host. clone ( ) ,
193+ remote_path : remote_path. clone ( ) ,
194194 identity : StringFileData :: OnDisk ( identity. into ( ) ) ,
195195 } )
196196 }
@@ -205,16 +205,13 @@ impl FromStr for PathDescriptor {
205205
206206 let bucket = map
207207 . get ( S3_KEY_BUCKET )
208- . ok_or_else ( || anyhow:: anyhow!( "missing {S3_KEY_BUCKET}" ) ) ?
209- . to_string ( ) ;
208+ . ok_or_else ( || anyhow:: anyhow!( "missing {S3_KEY_BUCKET}" ) ) ?. clone ( ) ;
210209 let path = map
211210 . get ( S3_KEY_PATH )
212- . ok_or_else ( || anyhow:: anyhow!( "missing {S3_KEY_PATH}" ) ) ?
213- . to_string ( ) ;
211+ . ok_or_else ( || anyhow:: anyhow!( "missing {S3_KEY_PATH}" ) ) ?. clone ( ) ;
214212 let credentials_path = map
215213 . get ( S3_KEY_CREDENTIALS_PATH )
216- . ok_or_else ( || anyhow:: anyhow!( "missing {S3_KEY_CREDENTIALS_PATH}" ) ) ?
217- . to_string ( ) ;
214+ . ok_or_else ( || anyhow:: anyhow!( "missing {S3_KEY_CREDENTIALS_PATH}" ) ) ?. clone ( ) ;
218215
219216 let region = map. get ( S3_KEY_REGION ) . cloned ( ) ;
220217 let endpoint = map. get ( S3_KEY_ENDPOINT ) . cloned ( ) ;
@@ -278,7 +275,7 @@ fn parse_key_vals_string(
278275 ) ) ;
279276 }
280277
281- result_map. insert ( key. to_string ( ) , value. to_string ( ) ) ;
278+ result_map. insert ( key. clone ( ) , value. to_string ( ) ) ;
282279 }
283280
284281 for & key in required_keys {
0 commit comments