From 1ea340e1b99afbe8e10f69827fad8d6f57991681 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 17 Jun 2022 20:14:18 +0200 Subject: [PATCH] Remove explicit TryFrom, TryInto imports --- axum-core/src/response/append_headers.rs | 2 +- axum-core/src/response/into_response.rs | 2 +- axum-core/src/response/into_response_parts.rs | 5 +---- axum/src/response/redirect.rs | 1 - axum/src/test_helpers/test_client.rs | 5 +---- examples/reverse-proxy/src/main.rs | 2 +- 6 files changed, 5 insertions(+), 12 deletions(-) diff --git a/axum-core/src/response/append_headers.rs b/axum-core/src/response/append_headers.rs index 0eb7c14b40..d777332f90 100644 --- a/axum-core/src/response/append_headers.rs +++ b/axum-core/src/response/append_headers.rs @@ -1,6 +1,6 @@ use super::{IntoResponse, IntoResponseParts, Response, ResponseParts, TryIntoHeaderError}; use http::header::{HeaderName, HeaderValue}; -use std::{convert::TryInto, fmt}; +use std::fmt; /// Append headers to a response. /// diff --git a/axum-core/src/response/into_response.rs b/axum-core/src/response/into_response.rs index 336f2adb2d..1ad461f8b9 100644 --- a/axum-core/src/response/into_response.rs +++ b/axum-core/src/response/into_response.rs @@ -11,7 +11,7 @@ use http_body::{ }; use std::{ borrow::Cow, - convert::{Infallible, TryInto}, + convert::Infallible, fmt, pin::Pin, task::{Context, Poll}, diff --git a/axum-core/src/response/into_response_parts.rs b/axum-core/src/response/into_response_parts.rs index 00c2763de6..831e35cb43 100644 --- a/axum-core/src/response/into_response_parts.rs +++ b/axum-core/src/response/into_response_parts.rs @@ -3,10 +3,7 @@ use http::{ header::{HeaderMap, HeaderName, HeaderValue}, Extensions, StatusCode, }; -use std::{ - convert::{Infallible, TryInto}, - fmt, -}; +use std::{convert::Infallible, fmt}; /// Trait for adding headers and extensions to a response. /// diff --git a/axum/src/response/redirect.rs b/axum/src/response/redirect.rs index a994db7bcb..e11389e875 100644 --- a/axum/src/response/redirect.rs +++ b/axum/src/response/redirect.rs @@ -1,6 +1,5 @@ use axum_core::response::{IntoResponse, Response}; use http::{header::LOCATION, HeaderValue, StatusCode}; -use std::convert::TryFrom; /// Response that redirects the request to another location. /// diff --git a/axum/src/test_helpers/test_client.rs b/axum/src/test_helpers/test_client.rs index 34791b45b6..d52c61a6f4 100644 --- a/axum/src/test_helpers/test_client.rs +++ b/axum/src/test_helpers/test_client.rs @@ -5,10 +5,7 @@ use http::{ Request, StatusCode, }; use hyper::{Body, Server}; -use std::{ - convert::TryFrom, - net::{SocketAddr, TcpListener}, -}; +use std::net::{SocketAddr, TcpListener}; use tower::make::Shared; use tower_service::Service; diff --git a/examples/reverse-proxy/src/main.rs b/examples/reverse-proxy/src/main.rs index 849af0b3ac..a9d2a5c750 100644 --- a/examples/reverse-proxy/src/main.rs +++ b/examples/reverse-proxy/src/main.rs @@ -14,7 +14,7 @@ use axum::{ Router, }; use hyper::{client::HttpConnector, Body}; -use std::{convert::TryFrom, net::SocketAddr}; +use std::net::SocketAddr; type Client = hyper::client::Client;