Skip to content

Commit

Permalink
rustfmt some test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Jan 29, 2020
1 parent 452f7f6 commit 00d2713
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
14 changes: 6 additions & 8 deletions tests/h2-tests/tests/flow_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,13 @@ async fn stream_error_release_connection_capacity() {
let mut should_recv_frames = 2usize;

let err = body
.try_for_each(|bytes| {
async move {
should_recv_bytes -= bytes.len();
should_recv_frames -= 1;
if should_recv_bytes == 0 {
assert_eq!(should_recv_bytes, 0);
}
Ok(())
.try_for_each(|bytes| async move {
should_recv_bytes -= bytes.len();
should_recv_frames -= 1;
if should_recv_bytes == 0 {
assert_eq!(should_recv_bytes, 0);
}
Ok(())
})
.await
.expect_err("body");
Expand Down
18 changes: 8 additions & 10 deletions tests/h2-tests/tests/push_promise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,14 @@ async fn recv_push_works() {
assert_eq!(resp.status(), StatusCode::NOT_FOUND);
};
let check_pushed_response = async move {
let p = pushed.and_then(|headers| {
async move {
let (request, response) = headers.into_parts();
assert_eq!(request.into_parts().0.method, Method::GET);
let resp = response.await.unwrap();
assert_eq!(resp.status(), StatusCode::OK);
let b = util::concat(resp.into_body()).await.unwrap();
assert_eq!(b, "promised_data");
Ok(())
}
let p = pushed.and_then(|headers| async move {
let (request, response) = headers.into_parts();
assert_eq!(request.into_parts().0.method, Method::GET);
let resp = response.await.unwrap();
assert_eq!(resp.status(), StatusCode::OK);
let b = util::concat(resp.into_body()).await.unwrap();
assert_eq!(b, "promised_data");
Ok(())
});
let ps: Vec<_> = p.collect().await;
assert_eq!(1, ps.len())
Expand Down

0 comments on commit 00d2713

Please sign in to comment.