File tree 5 files changed +0
-13
lines changed
5 files changed +0
-13
lines changed Original file line number Diff line number Diff line change @@ -11,28 +11,24 @@ struct Message {
11
11
contents : String ,
12
12
}
13
13
14
- #[ allow( unused_mut) ] // Workaround clippy bug
15
14
async fn echo_string ( mut cx : Context < ( ) > ) -> String {
16
15
let msg = cx. body_string ( ) . await . unwrap ( ) ;
17
16
println ! ( "String: {}" , msg) ;
18
17
msg
19
18
}
20
19
21
- #[ allow( unused_mut) ] // Workaround clippy bug
22
20
async fn echo_bytes ( mut cx : Context < ( ) > ) -> Vec < u8 > {
23
21
let msg = cx. body_bytes ( ) . await . unwrap ( ) ;
24
22
println ! ( "Bytes: {:?}" , msg) ;
25
23
msg
26
24
}
27
25
28
- #[ allow( unused_mut) ] // Workaround clippy bug
29
26
async fn echo_json ( mut cx : Context < ( ) > ) -> EndpointResult {
30
27
let msg = cx. body_json ( ) . await . client_err ( ) ?;
31
28
println ! ( "JSON: {:?}" , msg) ;
32
29
Ok ( response:: json ( msg) )
33
30
}
34
31
35
- #[ allow( unused_mut) ] // Workaround clippy bug
36
32
async fn echo_form ( mut cx : Context < ( ) > ) -> EndpointResult {
37
33
let msg = cx. body_form ( ) . await ?;
38
34
println ! ( "Form: {:?}" , msg) ;
Original file line number Diff line number Diff line change @@ -6,12 +6,10 @@ async fn retrieve_cookie(mut cx: Context<()>) -> String {
6
6
format ! ( "hello cookies: {:?}" , cx. get_cookie( "hello" ) . unwrap( ) )
7
7
}
8
8
9
- #[ allow( unused_mut) ] // Workaround clippy bug
10
9
async fn set_cookie ( mut cx : Context < ( ) > ) {
11
10
cx. set_cookie ( Cookie :: new ( "hello" , "world" ) ) . unwrap ( ) ;
12
11
}
13
12
14
- #[ allow( unused_mut) ] // Workaround clippy bug
15
13
async fn remove_cookie ( mut cx : Context < ( ) > ) {
16
14
cx. remove_cookie ( Cookie :: named ( "hello" ) ) . unwrap ( ) ;
17
15
}
Original file line number Diff line number Diff line change @@ -37,13 +37,11 @@ impl Database {
37
37
}
38
38
}
39
39
40
- #[ allow( unused_mut) ] // Workaround clippy bug
41
40
async fn new_message ( mut cx : Context < Database > ) -> EndpointResult < String > {
42
41
let msg = cx. body_json ( ) . await . client_err ( ) ?;
43
42
Ok ( cx. state ( ) . insert ( msg) . to_string ( ) )
44
43
}
45
44
46
- #[ allow( unused_mut) ] // Workaround clippy bug
47
45
async fn set_message ( mut cx : Context < Database > ) -> EndpointResult < ( ) > {
48
46
let msg = cx. body_json ( ) . await . client_err ( ) ?;
49
47
let id = cx. param ( "id" ) . client_err ( ) ?;
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ struct Message {
9
9
file : Option < String > ,
10
10
}
11
11
12
- #[ allow( unused_mut) ] // Workaround clippy bug
13
12
async fn upload_file ( mut cx : Context < ( ) > ) -> EndpointResult {
14
13
// https://stackoverflow.com/questions/43424982/how-to-parse-multipart-forms-using-abonander-multipart-with-rocket
15
14
let mut message = Message {
Original file line number Diff line number Diff line change @@ -72,23 +72,19 @@ mod tests {
72
72
static COOKIE_NAME : & str = "testCookie" ;
73
73
74
74
/// Tide will use the the `Cookies`'s `Extract` implementation to build this parameter.
75
- #[ allow( unused_mut) ] // Workaround clippy bug
76
75
async fn retrieve_cookie ( mut cx : Context < ( ) > ) -> String {
77
76
format ! ( "{}" , cx. get_cookie( COOKIE_NAME ) . unwrap( ) . unwrap( ) . value( ) )
78
77
}
79
78
80
- #[ allow( unused_mut) ] // Workaround clippy bug
81
79
async fn set_cookie ( mut cx : Context < ( ) > ) {
82
80
cx. set_cookie ( Cookie :: new ( COOKIE_NAME , "NewCookieValue" ) )
83
81
. unwrap ( ) ;
84
82
}
85
83
86
- #[ allow( unused_mut) ] // Workaround clippy bug
87
84
async fn remove_cookie ( mut cx : Context < ( ) > ) {
88
85
cx. remove_cookie ( Cookie :: named ( COOKIE_NAME ) ) . unwrap ( ) ;
89
86
}
90
87
91
- #[ allow( unused_mut) ] // Workaround clippy bug
92
88
async fn set_multiple_cookie ( mut cx : Context < ( ) > ) {
93
89
cx. set_cookie ( Cookie :: new ( "C1" , "V1" ) ) . unwrap ( ) ;
94
90
cx. set_cookie ( Cookie :: new ( "C2" , "V2" ) ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments