Update to hyper 0.13

This commit is contained in:
Gleb Pomykalov
2019-12-11 03:24:05 +03:00
committed by Sean McArthur
parent db2de90e42
commit 0f32c4a01a
23 changed files with 469 additions and 219 deletions

View File

@@ -1,7 +1,7 @@
mod support;
use support::*;
use std::time::{Duration, Instant};
use std::time::Duration;
#[tokio::test]
async fn request_timeout() {
@@ -10,7 +10,7 @@ async fn request_timeout() {
let server = server::http(move |_req| {
async {
// delay returning the response
tokio::timer::delay(Instant::now() + Duration::from_secs(2)).await;
tokio::time::delay_for(Duration::from_secs(2)).await;
http::Response::default()
}
});
@@ -38,7 +38,7 @@ async fn response_timeout() {
async {
// immediate response, but delayed body
let body = hyper::Body::wrap_stream(futures_util::stream::once(async {
tokio::timer::delay(Instant::now() + Duration::from_secs(2)).await;
tokio::time::delay_for(Duration::from_secs(2)).await;
Ok::<_, std::convert::Infallible>("Hello")
}));
@@ -77,7 +77,7 @@ fn timeout_closes_connection() {
let server = server::http(move |_req| {
async {
// delay returning the response
tokio::timer::delay(Instant::now() + Duration::from_secs(2)).await;
tokio::time::delay_for(Duration::from_secs(2)).await;
http::Response::default()
}
});
@@ -106,7 +106,7 @@ fn write_timeout_large_body() {
let server = server::http(move |_req| {
async {
// delay returning the response
tokio::timer::delay(Instant::now() + Duration::from_secs(2)).await;
tokio::time::delay_for(Duration::from_secs(2)).await;
http::Response::default()
}
});