@@ -41,15 +41,15 @@ async fn wildcard() {
4141 Method :: Get ,
4242 Url :: parse ( "http://localhost/add_one/3" ) . unwrap ( ) ,
4343 ) ;
44- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
44+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
4545 assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
4646 assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "4" ) ;
4747
4848 let req = http:: Request :: new (
4949 Method :: Get ,
5050 Url :: parse ( "http://localhost/add_one/-7" ) . unwrap ( ) ,
5151 ) ;
52- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
52+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
5353 assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
5454 assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "-6" ) ;
5555}
@@ -89,20 +89,20 @@ async fn wild_path() {
8989 Method :: Get ,
9090 Url :: parse ( "http://localhost/echo/some_path" ) . unwrap ( ) ,
9191 ) ;
92- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
92+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
9393 assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
9494 assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "some_path" ) ;
9595
9696 let req = http:: Request :: new (
9797 Method :: Get ,
9898 Url :: parse ( "http://localhost/echo/multi/segment/path" ) . unwrap ( ) ,
9999 ) ;
100- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
100+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
101101 assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
102102 assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "multi/segment/path" ) ;
103103
104104 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 ( ) ;
106106 assert_eq ! ( res. status( ) , StatusCode :: NotFound ) ;
107107 assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "" ) ;
108108}
@@ -116,15 +116,15 @@ async fn multi_wildcard() {
116116 Method :: Get ,
117117 Url :: parse ( "http://localhost/add_two/1/2/" ) . unwrap ( ) ,
118118 ) ;
119- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
119+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
120120 assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
121121 assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "3" ) ;
122122
123123 let req = http:: Request :: new (
124124 Method :: Get ,
125125 Url :: parse ( "http://localhost/add_two/-1/2/" ) . unwrap ( ) ,
126126 ) ;
127- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
127+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
128128 assert_eq ! ( res. status( ) , 200 ) ;
129129 assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "1" ) ;
130130
@@ -145,15 +145,15 @@ async fn wild_last_segment() {
145145 Method :: Get ,
146146 Url :: parse ( "http://localhost/echo/one/two" ) . unwrap ( ) ,
147147 ) ;
148- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
148+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
149149 assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
150150 assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "one" ) ;
151151
152152 let req = http:: Request :: new (
153153 Method :: Get ,
154154 Url :: parse ( "http://localhost/echo/one/two/three/four" ) . unwrap ( ) ,
155155 ) ;
156- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
156+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
157157 assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
158158 assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "one" ) ;
159159}
@@ -207,15 +207,15 @@ async fn nameless_internal_wildcard() {
207207 Method :: Get ,
208208 Url :: parse ( "http://localhost/echo/one/two" ) . unwrap ( ) ,
209209 ) ;
210- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
210+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
211211 assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
212212 assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "two" ) ;
213213
214214 let req = http:: Request :: new (
215215 Method :: Get ,
216216 Url :: parse ( "http://localhost/echo/one/two" ) . unwrap ( ) ,
217217 ) ;
218- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
218+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
219219 assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
220220 assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "two" ) ;
221221}
@@ -229,7 +229,7 @@ async fn nameless_internal_wildcard2() {
229229 Method :: Get ,
230230 Url :: parse ( "http://localhost/echo/one/two" ) . unwrap ( ) ,
231231 ) ;
232- let res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
232+ let mut res: http:: Response = app. respond ( req) . await . unwrap ( ) ;
233233 assert_eq ! ( res. status( ) , StatusCode :: Ok ) ;
234234 assert_eq ! ( & res. body_string( ) . await . unwrap( ) , "one" ) ;
235235}
0 commit comments