mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-23 00:00:15 +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:
@@ -1,5 +1,5 @@
|
||||
use super::*;
|
||||
use futures_util::future::{pending, ready};
|
||||
use std::future::{pending, ready};
|
||||
use tower::{timeout::TimeoutLayer, MakeService};
|
||||
|
||||
async fn unit() {}
|
||||
|
||||
+3
-2
@@ -9,7 +9,6 @@ use crate::{
|
||||
service, Router,
|
||||
};
|
||||
use bytes::Bytes;
|
||||
use futures_util::future::Ready;
|
||||
use http::{
|
||||
header::{HeaderMap, AUTHORIZATION},
|
||||
Request, Response, StatusCode, Uri,
|
||||
@@ -17,9 +16,11 @@ use http::{
|
||||
use hyper::{Body, Server};
|
||||
use serde::Deserialize;
|
||||
use serde_json::json;
|
||||
use std::future::Ready;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
convert::Infallible,
|
||||
future::ready,
|
||||
net::{SocketAddr, TcpListener},
|
||||
task::{Context, Poll},
|
||||
time::Duration,
|
||||
@@ -550,7 +551,7 @@ async fn wrong_method_service() {
|
||||
}
|
||||
|
||||
fn call(&mut self, _req: R) -> Self::Future {
|
||||
futures_util::future::ok(Response::new(http_body::Empty::new()))
|
||||
ready(Ok(Response::new(http_body::Empty::new())))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user