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
+5 -7
View File
@@ -1,13 +1,13 @@
use openssl::ssl::{Ssl, SslAcceptor, SslFiletype, SslMethod};
use tokio_openssl::SslStream;
use axum::{body::Body, extract::ConnectInfo, http::Request, routing::get, Router};
use axum::{body::Body, http::Request, routing::get, Router};
use futures_util::future::poll_fn;
use hyper::server::{
accept::Accept,
conn::{AddrIncoming, Http},
};
use std::{net::SocketAddr, path::PathBuf, pin::Pin, sync::Arc};
use std::{path::PathBuf, pin::Pin, sync::Arc};
use tokio::net::TcpListener;
use tower::MakeService;
@@ -52,9 +52,7 @@ async fn main() {
let protocol = Arc::new(Http::new());
let mut app = Router::new()
.route("/", get(handler))
.into_make_service_with_connect_info::<SocketAddr>();
let mut app = Router::new().route("/", get(handler)).into_make_service();
tracing::info!("listening on https://localhost:3000");
@@ -83,6 +81,6 @@ async fn main() {
}
}
async fn handler(ConnectInfo(addr): ConnectInfo<SocketAddr>) -> String {
addr.to_string()
async fn handler() -> &'static str {
"Hello, World!"
}