1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-30 16:40:21 +02:00

upgrade to tokio 0.2

This commit is contained in:
Nikolay Kim
2019-12-05 23:35:43 +06:00
parent b45c6cd66b
commit 205a964d8f
72 changed files with 764 additions and 555 deletions

View File

@@ -1,3 +1,4 @@
use std::convert::TryFrom;
use std::net;
use std::rc::Rc;
use std::time::Duration;
@@ -8,9 +9,7 @@ use serde::Serialize;
use actix_http::body::Body;
use actix_http::http::header::IntoHeaderValue;
use actix_http::http::{
Error as HttpError, HeaderMap, HeaderName, HttpTryFrom, Method, Uri,
};
use actix_http::http::{Error as HttpError, HeaderMap, HeaderName, Method, Uri};
use actix_http::{Error, RequestHead};
use crate::sender::{RequestSender, SendClientRequest};
@@ -112,7 +111,8 @@ impl FrozenClientRequest {
/// Create a `FrozenSendBuilder` with an extra header
pub fn extra_header<K, V>(&self, key: K, value: V) -> FrozenSendBuilder
where
HeaderName: HttpTryFrom<K>,
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
V: IntoHeaderValue,
{
self.extra_headers(HeaderMap::new())
@@ -139,7 +139,8 @@ impl FrozenSendBuilder {
/// Insert a header, it overrides existing header in `FrozenClientRequest`.
pub fn extra_header<K, V>(mut self, key: K, value: V) -> Self
where
HeaderName: HttpTryFrom<K>,
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
V: IntoHeaderValue,
{
match HeaderName::try_from(key) {