remove builder use in a couple more places

This commit is contained in:
Rob Ede 2021-04-13 23:58:25 +01:00
parent 427f39bf70
commit c4b2ab0c3d
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
3 changed files with 4 additions and 8 deletions

View File

@ -332,8 +332,7 @@ async fn test_h2_body_length() {
.h2(|_| { .h2(|_| {
let body = once(ok(Bytes::from_static(STR.as_ref()))); let body = once(ok(Bytes::from_static(STR.as_ref())));
ok::<_, ()>( ok::<_, ()>(
Response::build(StatusCode::OK) Response::ok().set_body(SizedStream::new(STR.len() as u64, body)),
.body(SizedStream::new(STR.len() as u64, body)),
) )
}) })
.openssl(tls_config()) .openssl(tls_config())

View File

@ -349,8 +349,7 @@ async fn test_h2_body_length() {
.h2(|_| { .h2(|_| {
let body = once(ok(Bytes::from_static(STR.as_ref()))); let body = once(ok(Bytes::from_static(STR.as_ref())));
ok::<_, ()>( ok::<_, ()>(
Response::build(StatusCode::OK) Response::ok().set_body(SizedStream::new(STR.len() as u64, body)),
.body(SizedStream::new(STR.len() as u64, body)),
) )
}) })
.rustls(tls_config()) .rustls(tls_config())

View File

@ -135,8 +135,7 @@ async fn test_chunked_payload() {
.fold(0usize, |acc, chunk| ready(acc + chunk.len())) .fold(0usize, |acc, chunk| ready(acc + chunk.len()))
.map(|req_size| { .map(|req_size| {
Ok::<_, Error>( Ok::<_, Error>(
Response::build(StatusCode::OK) Response::ok().set_body(format!("size={}", req_size)),
.body(format!("size={}", req_size)),
) )
}) })
})) }))
@ -545,8 +544,7 @@ async fn test_h1_body_length() {
.h1(|_| { .h1(|_| {
let body = once(ok(Bytes::from_static(STR.as_ref()))); let body = once(ok(Bytes::from_static(STR.as_ref())));
ok::<_, ()>( ok::<_, ()>(
Response::build(StatusCode::OK) Response::ok().set_body(SizedStream::new(STR.len() as u64, body)),
.body(SizedStream::new(STR.len() as u64, body)),
) )
}) })
.tcp() .tcp()