File tree 4 files changed +13
-8
lines changed 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: data:: CookieData ;
2
2
use futures:: future:: BoxFuture ;
3
- use http:: header:: HeaderValue ;
4
3
use futures:: prelude:: * ;
4
+ use http:: header:: HeaderValue ;
5
5
6
6
use tide_core:: {
7
7
middleware:: { Middleware , Next } ,
Original file line number Diff line number Diff line change 69
69
type Fut = BoxFuture < ' static , Response > ;
70
70
fn call ( & self , cx : Context < State > ) -> Self :: Fut {
71
71
let fut = ( self ) ( cx) ;
72
- FutureExt :: boxed ( async move {
73
- fut. await . into_response ( )
74
- } )
72
+ FutureExt :: boxed ( async move { fut. await . into_response ( ) } )
75
73
}
76
74
}
Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ impl<State: 'static> Router<State> {
64
64
65
65
fn not_found_endpoint < Data > ( _cx : Context < Data > ) -> BoxFuture < ' static , Response > {
66
66
FutureExt :: boxed ( async move {
67
- http:: Response :: builder ( ) . status ( http:: StatusCode :: NOT_FOUND ) . body ( Body :: empty ( ) ) . unwrap ( )
67
+ http:: Response :: builder ( )
68
+ . status ( http:: StatusCode :: NOT_FOUND )
69
+ . body ( Body :: empty ( ) )
70
+ . unwrap ( )
68
71
} )
69
72
}
Original file line number Diff line number Diff line change
1
+ use futures:: prelude:: * ;
1
2
use http_service:: Body ;
2
3
use multipart:: server:: Multipart ;
3
- use futures:: prelude:: * ;
4
4
use std:: io:: Cursor ;
5
5
6
6
use crate :: {
@@ -22,7 +22,9 @@ impl<State: Send + Sync + 'static> ExtractForms for Context<State> {
22
22
let body = self . take_body ( ) ;
23
23
FutureExt :: boxed ( async move {
24
24
let body = body. into_vec ( ) . await . client_err ( ) ?;
25
- Ok ( serde_urlencoded:: from_bytes ( & body) . map_err ( |e| err_fmt ! ( "could not decode form: {}" , e) ) . client_err ( ) ?)
25
+ Ok ( serde_urlencoded:: from_bytes ( & body)
26
+ . map_err ( |e| err_fmt ! ( "could not decode form: {}" , e) )
27
+ . client_err ( ) ?)
26
28
} )
27
29
}
28
30
@@ -38,7 +40,9 @@ impl<State: Send + Sync + 'static> ExtractForms for Context<State> {
38
40
39
41
FutureExt :: boxed ( async move {
40
42
let body = body. into_vec ( ) . await . client_err ( ) ?;
41
- let boundary = boundary. ok_or_else ( || err_fmt ! ( "no boundary found" ) ) . client_err ( ) ?;
43
+ let boundary = boundary
44
+ . ok_or_else ( || err_fmt ! ( "no boundary found" ) )
45
+ . client_err ( ) ?;
42
46
Ok ( Multipart :: with_body ( Cursor :: new ( body) , boundary) )
43
47
} )
44
48
}
You can’t perform that action at this time.
0 commit comments