1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-20 00:21:07 +00:00

remove unused code

This commit is contained in:
Nikolay Kim 2019-03-26 22:33:01 -07:00
parent 959aebb24f
commit b7570b2476
3 changed files with 9 additions and 27 deletions

View file

@ -65,13 +65,14 @@ impl ClientBuilder {
}
/// Do not add default request headers.
/// By default `Accept-Encoding` and `User-Agent` headers are set.
pub fn skip_default_headers(mut self) -> Self {
/// By default `Date` and `User-Agent` headers are set.
pub fn no_default_headers(mut self) -> Self {
self.default_headers = false;
self
}
/// Add default header. This header adds to every request.
/// Add default header. Headers adds byt this method
/// get added to every request.
pub fn header<K, V>(mut self, key: K, value: V) -> Self
where
HeaderName: HttpTryFrom<K>,
@ -91,7 +92,7 @@ impl ClientBuilder {
self
}
/// Finish build process and create `Client`.
/// Finish build process and create `Client` instance.
pub fn finish(self) -> Client {
Client {
connector: self.connector,

View file

@ -141,13 +141,11 @@ impl ClientRequest {
/// To override header use `set_header()` method.
///
/// ```rust
/// # extern crate actix_http;
/// #
/// use actix_http::{client, http};
/// use awc::{http, Client};
///
/// fn main() {
/// # actix_rt::System::new("test").block_on(futures::future::lazy(|| {
/// let req = awc::Client::new()
/// let req = Client::new()
/// .get("http://www.rust-lang.org")
/// .header("X-TEST", "value")
/// .header(http::header::CONTENT_TYPE, "application/json");
@ -304,7 +302,7 @@ impl ClientRequest {
}
/// Do not add default request headers.
/// By default `Accept-Encoding` and `User-Agent` headers are set.
/// By default `Date` and `User-Agent` headers are set.
pub fn no_default_headers(mut self) -> Self {
self.default_headers = false;
self
@ -394,7 +392,7 @@ impl ClientRequest {
// user agent
self.set_header_if_none(
header::USER_AGENT,
concat!("actix-http/", env!("CARGO_PKG_VERSION")),
concat!("awc/", env!("CARGO_PKG_VERSION")),
)
} else {
self

View file

@ -71,11 +71,6 @@ impl<S> ClientResponse<S> {
&self.head
}
#[inline]
pub(crate) fn head_mut(&mut self) -> &mut ResponseHead {
&mut self.head
}
/// Read the Request Version.
#[inline]
pub fn version(&self) -> Version {
@ -94,18 +89,6 @@ impl<S> ClientResponse<S> {
&self.head().headers
}
#[inline]
/// Returns mutable Request's headers.
pub fn headers_mut(&mut self) -> &mut HeaderMap {
&mut self.head_mut().headers
}
/// Checks if a connection should be kept alive.
#[inline]
pub fn keep_alive(&self) -> bool {
self.head().keep_alive()
}
/// Set a body and return previous body value
pub fn map_body<F, U>(mut self, f: F) -> ClientResponse<U>
where