Skip to content

Commit

Permalink
test_client: Remove redundant status() fn
Browse files Browse the repository at this point in the history
This returns the same as the `status()` fn of the inner `response`, so we might as well take advantage of the `Deref` implementation.
  • Loading branch information
Turbo87 committed Dec 23, 2024
1 parent eff3d2f commit 4471709
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions axum/src/test_helpers/test_client.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use super::{serve, Request, Response};
use bytes::Bytes;
use futures_util::future::BoxFuture;
use http::{
header::{HeaderName, HeaderValue},
StatusCode,
};
use http::header::{HeaderName, HeaderValue};
use std::ops::Deref;
use std::{convert::Infallible, future::IntoFuture, net::SocketAddr};
use tokio::net::TcpListener;
Expand Down Expand Up @@ -171,10 +168,6 @@ impl TestResponse {
self.response.json().await.unwrap()
}

pub(crate) fn status(&self) -> StatusCode {
StatusCode::from_u16(self.response.status().as_u16()).unwrap()
}

pub(crate) fn headers(&self) -> http::HeaderMap {
self.response.headers().clone()
}
Expand Down

0 comments on commit 4471709

Please sign in to comment.