File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -239,11 +239,11 @@ mod tests {
239
239
240
240
fn expect_304 ( response : Result < Response , Box < Error +Send > > ) {
241
241
let mut response = response. ok ( ) . expect ( "No response" ) ;
242
- let mut body = String :: new ( ) ;
243
- response. body . read_to_string ( & mut body) . ok ( ) . expect ( "No body" ) ;
242
+ let mut body = Vec :: new ( ) ;
243
+ response. body . write_body ( & mut body) . ok ( ) . expect ( "No body" ) ;
244
244
245
245
assert_eq ! ( response. status, ( 304 , "Not Modified" ) ) ;
246
- assert_eq ! ( body, "" ) ;
246
+ assert_eq ! ( body, b "") ;
247
247
}
248
248
249
249
fn expect_200 ( response : Result < Response , Box < Error +Send > > ) {
@@ -252,11 +252,11 @@ mod tests {
252
252
253
253
fn expect ( status : ( u32 , & ' static str ) , response : Result < Response , Box < Error +Send > > ) {
254
254
let mut response = response. ok ( ) . expect ( "No response" ) ;
255
- let mut body = String :: new ( ) ;
256
- response. body . read_to_string ( & mut body) . ok ( ) . expect ( "No body" ) ;
255
+ let mut body = Vec :: new ( ) ;
256
+ response. body . write_body ( & mut body) . ok ( ) . expect ( "No body" ) ;
257
257
258
258
assert_eq ! ( response. status, status) ;
259
- assert_eq ! ( body, "hello" ) ;
259
+ assert_eq ! ( body, b "hello") ;
260
260
}
261
261
262
262
struct SimpleHandler {
You can’t perform that action at this time.
0 commit comments