From b168fcd606bec80c910d46081d82a9b0f02169d5 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Tue, 14 Dec 2021 22:26:52 +0000 Subject: [PATCH] test util body errors only require Debug --- src/test.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test.rs b/src/test.rs index 13a049089..e132eb860 100644 --- a/src/test.rs +++ b/src/test.rs @@ -1,6 +1,6 @@ //! Various helpers for Actix applications to use during testing. -use std::{borrow::Cow, net::SocketAddr, rc::Rc}; +use std::{borrow::Cow, fmt, net::SocketAddr, rc::Rc}; pub use actix_http::test::TestBuffer; use actix_http::{ @@ -157,12 +157,12 @@ pub async fn read_response(app: &S, req: Request) -> Bytes where S: Service, Error = Error>, B: MessageBody + Unpin, - B::Error: Into, + B::Error: fmt::Debug, { let resp = app .call(req) .await - .unwrap_or_else(|e| panic!("read_response failed at application call: {}", e)); + .unwrap_or_else(|e| panic!("read_response failed at application call: {:?}", e)); let body = resp.into_body(); let mut bytes = BytesMut::new(); @@ -204,7 +204,7 @@ where pub async fn read_body(res: ServiceResponse) -> Bytes where B: MessageBody + Unpin, - B::Error: Into, + B::Error: fmt::Debug, { let body = res.into_body(); let mut bytes = BytesMut::new(); @@ -257,7 +257,7 @@ where pub async fn read_body_json(res: ServiceResponse) -> T where B: MessageBody + Unpin, - B::Error: Into, + B::Error: fmt::Debug, T: DeserializeOwned, { let body = read_body(res).await; @@ -308,7 +308,7 @@ pub async fn read_response_json(app: &S, req: Request) -> T where S: Service, Error = Error>, B: MessageBody + Unpin, - B::Error: Into, + B::Error: fmt::Debug, T: DeserializeOwned, { let body = read_response(app, req).await;