mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-30 00:00:32 +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:
@@ -22,7 +22,7 @@ pub use super::or::ResponseFuture as OrResponseFuture;
|
||||
opaque_future! {
|
||||
/// Response future for [`EmptyRouter`](super::EmptyRouter).
|
||||
pub type EmptyRouterFuture<E> =
|
||||
futures_util::future::Ready<Result<Response<BoxBody>, E>>;
|
||||
std::future::Ready<Result<Response<BoxBody>, E>>;
|
||||
}
|
||||
|
||||
pin_project! {
|
||||
@@ -185,5 +185,5 @@ where
|
||||
opaque_future! {
|
||||
/// Response future from [`MakeRouteService`] services.
|
||||
pub type MakeRouteServiceFuture<S> =
|
||||
futures_util::future::Ready<Result<S, Infallible>>;
|
||||
std::future::Ready<Result<S, Infallible>>;
|
||||
}
|
||||
|
||||
+3
-2
@@ -19,6 +19,7 @@ use std::{
|
||||
borrow::Cow,
|
||||
convert::Infallible,
|
||||
fmt,
|
||||
future::ready,
|
||||
marker::PhantomData,
|
||||
sync::Arc,
|
||||
task::{Context, Poll},
|
||||
@@ -722,7 +723,7 @@ where
|
||||
|
||||
*res.status_mut() = self.status;
|
||||
EmptyRouterFuture {
|
||||
future: futures_util::future::ok(res),
|
||||
future: ready(Ok(res)),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1059,7 +1060,7 @@ where
|
||||
|
||||
fn call(&mut self, _target: T) -> Self::Future {
|
||||
future::MakeRouteServiceFuture {
|
||||
future: futures_util::future::ready(Ok(self.service.clone())),
|
||||
future: ready(Ok(self.service.clone())),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user