@@ -23,43 +23,47 @@ use crate::s3::builders::{
23
23
24
24
impl Client {
25
25
/// Executes [UploadPartCopy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html) S3 API
26
- pub fn upload_part_copy ( & self , bucket : & str , object : & str , upload_id : & str ) -> UploadPartCopy {
27
- UploadPartCopy :: new (
28
- self ,
29
- bucket . to_owned ( ) ,
30
- object . to_owned ( ) ,
31
- upload_id . to_owned ( ) ,
32
- )
26
+ pub fn upload_part_copy < S : Into < String > > (
27
+ & self ,
28
+ bucket : S ,
29
+ object : S ,
30
+ upload_id : S ,
31
+ ) -> UploadPartCopy {
32
+ UploadPartCopy :: new ( self . clone ( ) , bucket . into ( ) , object . into ( ) , upload_id . into ( ) )
33
33
}
34
34
35
35
/// Create a CopyObject request builder. This is a lower-level API that
36
36
/// performs a non-multipart object copy.
37
- pub fn copy_object_internal ( & self , bucket : & str , object : & str ) -> CopyObjectInternal {
38
- CopyObjectInternal :: new ( self , bucket. to_owned ( ) , object. to_owned ( ) )
37
+ pub fn copy_object_internal < S : Into < String > > (
38
+ & self ,
39
+ bucket : S ,
40
+ object : S ,
41
+ ) -> CopyObjectInternal {
42
+ CopyObjectInternal :: new ( self . clone ( ) , bucket. into ( ) , object. into ( ) )
39
43
}
40
44
41
45
/// copy object is a high-order API that calls [`stat_object`] and based on the results calls
42
46
/// either [`compose_object`] or [`copy_object_internal`] to copy the object.
43
- pub fn copy_object ( & self , bucket : & str , object : & str ) -> CopyObject {
44
- CopyObject :: new ( self , bucket. to_owned ( ) , object. to_owned ( ) )
47
+ pub fn copy_object < S : Into < String > > ( & self , bucket : S , object : S ) -> CopyObject {
48
+ CopyObject :: new ( self . clone ( ) , bucket. into ( ) , object. into ( ) )
45
49
}
46
50
47
- pub ( crate ) fn compose_object_internal (
51
+ pub ( crate ) fn compose_object_internal < S : Into < String > > (
48
52
& self ,
49
- bucket : & str ,
50
- object : & str ,
53
+ bucket : S ,
54
+ object : S ,
51
55
) -> ComposeObjectInternal {
52
- ComposeObjectInternal :: new ( self , bucket. to_owned ( ) , object. to_owned ( ) )
56
+ ComposeObjectInternal :: new ( self . clone ( ) , bucket. into ( ) , object. into ( ) )
53
57
}
54
58
55
59
/// compose object is high-order API that calls [`compose_object_internal`] and if that call fails,
56
60
/// it calls ['abort_multipart_upload`].
57
- pub fn compose_object (
61
+ pub fn compose_object < S : Into < String > > (
58
62
& self ,
59
- bucket : & str ,
60
- object : & str ,
63
+ bucket : S ,
64
+ object : S ,
61
65
sources : Vec < ComposeSource > ,
62
66
) -> ComposeObject {
63
- ComposeObject :: new ( self , bucket. to_owned ( ) , object. to_owned ( ) ) . sources ( sources)
67
+ ComposeObject :: new ( self . clone ( ) , bucket. into ( ) , object. into ( ) ) . sources ( sources)
64
68
}
65
69
}
0 commit comments