@@ -41,15 +41,15 @@ async fn wildcard() {
41
41
Method :: Get ,
42
42
Url :: parse ( "http://localhost/add_one/3" ) . unwrap ( ) ,
43
43
) ;
44
- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
44
+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
45
45
assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
46
46
assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "4" ) ;
47
47
48
48
let req = http:: Request :: new (
49
49
Method :: Get ,
50
50
Url :: parse ( "http://localhost/add_one/-7" ) . unwrap ( ) ,
51
51
) ;
52
- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
52
+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
53
53
assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
54
54
assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "-6" ) ;
55
55
}
@@ -89,20 +89,20 @@ async fn wild_path() {
89
89
Method :: Get ,
90
90
Url :: parse ( "http://localhost/echo/some_path" ) . unwrap ( ) ,
91
91
) ;
92
- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
92
+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
93
93
assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
94
94
assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "some_path" ) ;
95
95
96
96
let req = http:: Request :: new (
97
97
Method :: Get ,
98
98
Url :: parse ( "http://localhost/echo/multi/segment/path" ) . unwrap ( ) ,
99
99
) ;
100
- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
100
+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
101
101
assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
102
102
assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "multi/segment/path" ) ;
103
103
104
104
let req = http:: Request :: new ( Method :: Get , Url :: parse ( "http://localhost/echo/" ) . unwrap ( ) ) ;
105
- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
105
+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
106
106
assert_eq ! ( res. status( ) , StatusCode :: NotFound ) ;
107
107
assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "" ) ;
108
108
}
@@ -116,15 +116,15 @@ async fn multi_wildcard() {
116
116
Method :: Get ,
117
117
Url :: parse ( "http://localhost/add_two/1/2/" ) . unwrap ( ) ,
118
118
) ;
119
- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
119
+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
120
120
assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
121
121
assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "3" ) ;
122
122
123
123
let req = http:: Request :: new (
124
124
Method :: Get ,
125
125
Url :: parse ( "http://localhost/add_two/-1/2/" ) . unwrap ( ) ,
126
126
) ;
127
- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
127
+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
128
128
assert_eq ! ( res. status( ) , 200 ) ;
129
129
assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "1" ) ;
130
130
@@ -145,15 +145,15 @@ async fn wild_last_segment() {
145
145
Method :: Get ,
146
146
Url :: parse ( "http://localhost/echo/one/two" ) . unwrap ( ) ,
147
147
) ;
148
- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
148
+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
149
149
assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
150
150
assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "one" ) ;
151
151
152
152
let req = http:: Request :: new (
153
153
Method :: Get ,
154
154
Url :: parse ( "http://localhost/echo/one/two/three/four" ) . unwrap ( ) ,
155
155
) ;
156
- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
156
+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
157
157
assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
158
158
assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "one" ) ;
159
159
}
@@ -207,15 +207,15 @@ async fn nameless_internal_wildcard() {
207
207
Method :: Get ,
208
208
Url :: parse ( "http://localhost/echo/one/two" ) . unwrap ( ) ,
209
209
) ;
210
- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
210
+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
211
211
assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
212
212
assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "two" ) ;
213
213
214
214
let req = http:: Request :: new (
215
215
Method :: Get ,
216
216
Url :: parse ( "http://localhost/echo/one/two" ) . unwrap ( ) ,
217
217
) ;
218
- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
218
+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
219
219
assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
220
220
assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "two" ) ;
221
221
}
@@ -229,7 +229,7 @@ async fn nameless_internal_wildcard2() {
229
229
Method :: Get ,
230
230
Url :: parse ( "http://localhost/echo/one/two" ) . unwrap ( ) ,
231
231
) ;
232
- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
232
+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
233
233
assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
234
234
assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "one" ) ;
235
235
}
0 commit comments