@@ -10,7 +10,10 @@ use chrono::prelude::Utc;
10
10
use openssl:: hash:: MessageDigest ;
11
11
use openssl:: pkey:: PKey ;
12
12
use openssl:: sign:: Signer ;
13
- use reqwest:: header;
13
+ use reqwest:: {
14
+ blocking:: { Body , Client , Response } ,
15
+ header,
16
+ } ;
14
17
15
18
#[ derive( Clone , Debug ) ]
16
19
pub struct Bucket {
@@ -40,12 +43,12 @@ impl Bucket {
40
43
41
44
pub fn put < R : std:: io:: Read + Send + ' static > (
42
45
& self ,
43
- client : & reqwest :: Client ,
46
+ client : & Client ,
44
47
path : & str ,
45
48
content : R ,
46
49
content_length : u64 ,
47
50
content_type : & str ,
48
- ) -> reqwest:: Result < reqwest :: Response > {
51
+ ) -> reqwest:: Result < Response > {
49
52
let path = if path. starts_with ( '/' ) {
50
53
& path[ 1 ..]
51
54
} else {
@@ -60,16 +63,12 @@ impl Bucket {
60
63
. header ( header:: AUTHORIZATION , auth)
61
64
. header ( header:: CONTENT_TYPE , content_type)
62
65
. header ( header:: DATE , date)
63
- . body ( reqwest :: Body :: sized ( content, content_length) )
66
+ . body ( Body :: sized ( content, content_length) )
64
67
. send ( ) ?
65
68
. error_for_status ( )
66
69
}
67
70
68
- pub fn delete (
69
- & self ,
70
- client : & reqwest:: Client ,
71
- path : & str ,
72
- ) -> reqwest:: Result < reqwest:: Response > {
71
+ pub fn delete ( & self , client : & Client , path : & str ) -> reqwest:: Result < Response > {
73
72
let path = if path. starts_with ( '/' ) {
74
73
& path[ 1 ..]
75
74
} else {
0 commit comments