mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-21 00:00:14 +02:00
Use std::future::ready (#231)
`std::future::ready` has been stable since 1.48 so since axum's MSRV is 1.51 we can use this rather the one from `futures_util`.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
use super::{Extension, FromRequest, RequestParts};
|
||||
use async_trait::async_trait;
|
||||
use hyper::server::conn::AddrStream;
|
||||
use std::future::ready;
|
||||
use std::{
|
||||
convert::Infallible,
|
||||
fmt,
|
||||
@@ -90,7 +91,7 @@ where
|
||||
let connect_info = ConnectInfo(C::connect_info(target));
|
||||
let svc = AddExtension::new(self.svc.clone(), connect_info);
|
||||
ResponseFuture {
|
||||
future: futures_util::future::ok(svc),
|
||||
future: ready(Ok(svc)),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,7 +99,7 @@ where
|
||||
opaque_future! {
|
||||
/// Response future for [`IntoMakeServiceWithConnectInfo`].
|
||||
pub type ResponseFuture<T> =
|
||||
futures_util::future::Ready<Result<T, Infallible>>;
|
||||
std::future::Ready<Result<T, Infallible>>;
|
||||
}
|
||||
|
||||
/// Extractor for getting connection information produced by a [`Connected`].
|
||||
|
||||
Reference in New Issue
Block a user