rustfmt some test cases

This commit is contained in:
Sean McArthur
2020-01-29 15:21:11 -08:00
parent 8ca2eb2597
commit c5880076d5
2 changed files with 14 additions and 18 deletions

View File

@@ -346,15 +346,13 @@ async fn stream_error_release_connection_capacity() {
let mut should_recv_frames = 2usize; let mut should_recv_frames = 2usize;
let err = body let err = body
.try_for_each(|bytes| { .try_for_each(|bytes| async move {
async move { should_recv_bytes -= bytes.len();
should_recv_bytes -= bytes.len(); should_recv_frames -= 1;
should_recv_frames -= 1; if should_recv_bytes == 0 {
if should_recv_bytes == 0 { assert_eq!(should_recv_bytes, 0);
assert_eq!(should_recv_bytes, 0);
}
Ok(())
} }
Ok(())
}) })
.await .await
.expect_err("body"); .expect_err("body");

View File

@@ -39,16 +39,14 @@ async fn recv_push_works() {
assert_eq!(resp.status(), StatusCode::NOT_FOUND); assert_eq!(resp.status(), StatusCode::NOT_FOUND);
}; };
let check_pushed_response = async move { let check_pushed_response = async move {
let p = pushed.and_then(|headers| { let p = pushed.and_then(|headers| async move {
async move { let (request, response) = headers.into_parts();
let (request, response) = headers.into_parts(); assert_eq!(request.into_parts().0.method, Method::GET);
assert_eq!(request.into_parts().0.method, Method::GET); let resp = response.await.unwrap();
let resp = response.await.unwrap(); assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(resp.status(), StatusCode::OK); let b = util::concat(resp.into_body()).await.unwrap();
let b = util::concat(resp.into_body()).await.unwrap(); assert_eq!(b, "promised_data");
assert_eq!(b, "promised_data"); Ok(())
Ok(())
}
}); });
let ps: Vec<_> = p.collect().await; let ps: Vec<_> = p.collect().await;
assert_eq!(1, ps.len()) assert_eq!(1, ps.len())