Remove impl Connected<&AddrStream> for SocketAddr (#1954)

This commit is contained in:
David Pedersen
2023-04-21 18:24:47 +02:00
committed by GitHub
parent c378211b12
commit db300efc33
4 changed files with 9 additions and 20 deletions
-1
View File
@@ -191,7 +191,6 @@ allowed = [
"futures_util",
"http",
"http_body",
"hyper",
"serde",
"tokio",
"tower_layer",
-7
View File
@@ -8,7 +8,6 @@ use super::{Extension, FromRequestParts};
use crate::{middleware::AddExtension, serve::IncomingStream};
use async_trait::async_trait;
use http::request::Parts;
use hyper::server::conn::AddrStream;
use std::{
convert::Infallible,
fmt,
@@ -83,12 +82,6 @@ pub trait Connected<T>: Clone + Send + Sync + 'static {
fn connect_info(target: T) -> Self;
}
impl Connected<&AddrStream> for SocketAddr {
fn connect_info(target: &AddrStream) -> Self {
target.remote_addr()
}
}
impl Connected<IncomingStream<'_>> for SocketAddr {
fn connect_info(target: IncomingStream<'_>) -> Self {
target.remote_addr()