From c4b2ab0c3d4b267fb9bfb32395cd100df559b999 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Tue, 13 Apr 2021 23:58:25 +0100 Subject: [PATCH] remove builder use in a couple more places --- actix-http/tests/test_openssl.rs | 3 +-- actix-http/tests/test_rustls.rs | 3 +-- actix-http/tests/test_server.rs | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/actix-http/tests/test_openssl.rs b/actix-http/tests/test_openssl.rs index 5e6a40125..7cbd58518 100644 --- a/actix-http/tests/test_openssl.rs +++ b/actix-http/tests/test_openssl.rs @@ -332,8 +332,7 @@ async fn test_h2_body_length() { .h2(|_| { let body = once(ok(Bytes::from_static(STR.as_ref()))); ok::<_, ()>( - Response::build(StatusCode::OK) - .body(SizedStream::new(STR.len() as u64, body)), + Response::ok().set_body(SizedStream::new(STR.len() as u64, body)), ) }) .openssl(tls_config()) diff --git a/actix-http/tests/test_rustls.rs b/actix-http/tests/test_rustls.rs index 5d86db279..a122ab847 100644 --- a/actix-http/tests/test_rustls.rs +++ b/actix-http/tests/test_rustls.rs @@ -349,8 +349,7 @@ async fn test_h2_body_length() { .h2(|_| { let body = once(ok(Bytes::from_static(STR.as_ref()))); ok::<_, ()>( - Response::build(StatusCode::OK) - .body(SizedStream::new(STR.len() as u64, body)), + Response::ok().set_body(SizedStream::new(STR.len() as u64, body)), ) }) .rustls(tls_config()) diff --git a/actix-http/tests/test_server.rs b/actix-http/tests/test_server.rs index 2feb698d9..9b8b039c3 100644 --- a/actix-http/tests/test_server.rs +++ b/actix-http/tests/test_server.rs @@ -135,8 +135,7 @@ async fn test_chunked_payload() { .fold(0usize, |acc, chunk| ready(acc + chunk.len())) .map(|req_size| { Ok::<_, Error>( - Response::build(StatusCode::OK) - .body(format!("size={}", req_size)), + Response::ok().set_body(format!("size={}", req_size)), ) }) })) @@ -545,8 +544,7 @@ async fn test_h1_body_length() { .h1(|_| { let body = once(ok(Bytes::from_static(STR.as_ref()))); ok::<_, ()>( - Response::build(StatusCode::OK) - .body(SizedStream::new(STR.len() as u64, body)), + Response::ok().set_body(SizedStream::new(STR.len() as u64, body)), ) }) .tcp()