@@ -32,29 +32,29 @@ impl Builder {
32
32
// TODO: URL-encoded payload
33
33
pub fn insert ( mut self , body : & str ) -> Self {
34
34
self . method = Some ( Method :: POST ) ;
35
- self . headers . push ( ( "Prefer" . to_string ( ) , "return=representation" . to_string ( ) ) ) ;
35
+ self . headers
36
+ . push ( ( "Prefer" . to_string ( ) , "return=representation" . to_string ( ) ) ) ;
36
37
self . body = Some ( body. to_string ( ) ) ;
37
38
self
38
39
}
39
40
40
41
pub fn update ( mut self , body : & str ) -> Self {
41
42
self . method = Some ( Method :: PATCH ) ;
42
- self . headers . push ( ( "Prefer" . to_string ( ) , "return=representation" . to_string ( ) ) ) ;
43
+ self . headers
44
+ . push ( ( "Prefer" . to_string ( ) , "return=representation" . to_string ( ) ) ) ;
43
45
self . body = Some ( body. to_string ( ) ) ;
44
46
self
45
47
}
46
48
47
49
pub fn delete ( mut self ) -> Self {
48
50
self . method = Some ( Method :: DELETE ) ;
49
- self . headers . push ( ( "Prefer" . to_string ( ) , "return=representation" . to_string ( ) ) ) ;
51
+ self . headers
52
+ . push ( ( "Prefer" . to_string ( ) , "return=representation" . to_string ( ) ) ) ;
50
53
self
51
54
}
52
55
53
56
pub async fn execute ( self ) -> Result < Response , Error > {
54
- let mut req = Client :: new ( ) . request (
55
- self . method . unwrap ( ) ,
56
- & self . url ,
57
- ) ;
57
+ let mut req = Client :: new ( ) . request ( self . method . unwrap ( ) , & self . url ) ;
58
58
for ( k, v) in & self . headers {
59
59
req = req. header ( k, v) ;
60
60
}
@@ -63,8 +63,7 @@ impl Builder {
63
63
req = req. body ( body) ;
64
64
}
65
65
66
- let resp = req. send ( )
67
- . await ?;
66
+ let resp = req. send ( ) . await ?;
68
67
69
68
Ok ( resp)
70
69
}
0 commit comments