remove inline annotations on client builder methods

This commit is contained in:
Sean McArthur
2018-08-23 09:57:04 -07:00
parent afbeb1a384
commit ef529df3f2
2 changed files with 0 additions and 22 deletions

View File

@@ -134,7 +134,6 @@ impl ClientBuilder {
/// hostname verification is not used, any valid certificate for any /// hostname verification is not used, any valid certificate for any
/// site will be trusted for use from any other. This introduces a /// site will be trusted for use from any other. This introduces a
/// significant vulnerability to man-in-the-middle attacks. /// significant vulnerability to man-in-the-middle attacks.
#[inline]
pub fn danger_accept_invalid_hostnames(mut self, accept_invalid_hostname: bool) -> ClientBuilder { pub fn danger_accept_invalid_hostnames(mut self, accept_invalid_hostname: bool) -> ClientBuilder {
self.config.hostname_verification = !accept_invalid_hostname; self.config.hostname_verification = !accept_invalid_hostname;
self self
@@ -152,7 +151,6 @@ impl ClientBuilder {
/// will be trusted for use. This includes expired certificates. This /// will be trusted for use. This includes expired certificates. This
/// introduces significant vulnerabilities, and should only be used /// introduces significant vulnerabilities, and should only be used
/// as a last resort. /// as a last resort.
#[inline]
pub fn danger_accept_invalid_certs(mut self, accept_invalid_certs: bool) -> ClientBuilder { pub fn danger_accept_invalid_certs(mut self, accept_invalid_certs: bool) -> ClientBuilder {
self.config.certs_verification = !accept_invalid_certs; self.config.certs_verification = !accept_invalid_certs;
self self
@@ -160,7 +158,6 @@ impl ClientBuilder {
/// Sets the default headers for every request. /// Sets the default headers for every request.
#[inline]
pub fn default_headers(mut self, headers: HeaderMap) -> ClientBuilder { pub fn default_headers(mut self, headers: HeaderMap) -> ClientBuilder {
for (key, value) in headers.iter() { for (key, value) in headers.iter() {
self.config.headers.insert(key, value.clone()); self.config.headers.insert(key, value.clone());
@@ -171,14 +168,12 @@ impl ClientBuilder {
/// Enable auto gzip decompression by checking the ContentEncoding response header. /// Enable auto gzip decompression by checking the ContentEncoding response header.
/// ///
/// Default is enabled. /// Default is enabled.
#[inline]
pub fn gzip(mut self, enable: bool) -> ClientBuilder { pub fn gzip(mut self, enable: bool) -> ClientBuilder {
self.config.gzip = enable; self.config.gzip = enable;
self self
} }
/// Add a `Proxy` to the list of proxies the `Client` will use. /// Add a `Proxy` to the list of proxies the `Client` will use.
#[inline]
pub fn proxy(mut self, proxy: Proxy) -> ClientBuilder { pub fn proxy(mut self, proxy: Proxy) -> ClientBuilder {
self.config.proxies.push(proxy); self.config.proxies.push(proxy);
self self
@@ -187,7 +182,6 @@ impl ClientBuilder {
/// Set a `RedirectPolicy` for this client. /// Set a `RedirectPolicy` for this client.
/// ///
/// Default will follow redirects up to a maximum of 10. /// Default will follow redirects up to a maximum of 10.
#[inline]
pub fn redirect(mut self, policy: RedirectPolicy) -> ClientBuilder { pub fn redirect(mut self, policy: RedirectPolicy) -> ClientBuilder {
self.config.redirect_policy = policy; self.config.redirect_policy = policy;
self self
@@ -196,21 +190,18 @@ impl ClientBuilder {
/// Enable or disable automatic setting of the `Referer` header. /// Enable or disable automatic setting of the `Referer` header.
/// ///
/// Default is `true`. /// Default is `true`.
#[inline]
pub fn referer(mut self, enable: bool) -> ClientBuilder { pub fn referer(mut self, enable: bool) -> ClientBuilder {
self.config.referer = enable; self.config.referer = enable;
self self
} }
/// Set a timeout for both the read and write operations of a client. /// Set a timeout for both the read and write operations of a client.
#[inline]
pub fn timeout(mut self, timeout: Duration) -> ClientBuilder { pub fn timeout(mut self, timeout: Duration) -> ClientBuilder {
self.config.timeout = Some(timeout); self.config.timeout = Some(timeout);
self self
} }
/// Set number of DNS threads. /// Set number of DNS threads.
#[inline]
pub fn dns_threads(mut self, threads: usize) -> ClientBuilder { pub fn dns_threads(mut self, threads: usize) -> ClientBuilder {
self.config.dns_threads = threads; self.config.dns_threads = threads;
self self
@@ -227,7 +218,6 @@ impl Client {
/// This method panics if native TLS backend cannot be created or /// This method panics if native TLS backend cannot be created or
/// initialized. Use `Client::builder()` if you wish to handle the failure /// initialized. Use `Client::builder()` if you wish to handle the failure
/// as an `Error` instead of panicking. /// as an `Error` instead of panicking.
#[inline]
pub fn new() -> Client { pub fn new() -> Client {
ClientBuilder::new() ClientBuilder::new()
.build() .build()
@@ -235,7 +225,6 @@ impl Client {
} }
/// Creates a `ClientBuilder` to configure a `Client`. /// Creates a `ClientBuilder` to configure a `Client`.
#[inline]
pub fn builder() -> ClientBuilder { pub fn builder() -> ClientBuilder {
ClientBuilder::new() ClientBuilder::new()
} }

View File

@@ -147,7 +147,6 @@ impl ClientBuilder {
/// hostname verification is not used, any valid certificate for any /// hostname verification is not used, any valid certificate for any
/// site will be trusted for use from any other. This introduces a /// site will be trusted for use from any other. This introduces a
/// significant vulnerability to man-in-the-middle attacks. /// significant vulnerability to man-in-the-middle attacks.
#[inline]
pub fn danger_accept_invalid_hostnames(self, accept_invalid_hostname: bool) -> ClientBuilder { pub fn danger_accept_invalid_hostnames(self, accept_invalid_hostname: bool) -> ClientBuilder {
self.with_inner(|inner| inner.danger_accept_invalid_hostnames(accept_invalid_hostname)) self.with_inner(|inner| inner.danger_accept_invalid_hostnames(accept_invalid_hostname))
} }
@@ -164,7 +163,6 @@ impl ClientBuilder {
/// will be trusted for use. This includes expired certificates. This /// will be trusted for use. This includes expired certificates. This
/// introduces significant vulnerabilities, and should only be used /// introduces significant vulnerabilities, and should only be used
/// as a last resort. /// as a last resort.
#[inline]
pub fn danger_accept_invalid_certs(self, accept_invalid_certs: bool) -> ClientBuilder { pub fn danger_accept_invalid_certs(self, accept_invalid_certs: bool) -> ClientBuilder {
self.with_inner(|inner| inner.danger_accept_invalid_certs(accept_invalid_certs)) self.with_inner(|inner| inner.danger_accept_invalid_certs(accept_invalid_certs))
} }
@@ -207,7 +205,6 @@ impl ClientBuilder {
/// # Ok(()) /// # Ok(())
/// # } /// # }
/// ``` /// ```
#[inline]
pub fn default_headers(self, headers: header::HeaderMap) -> ClientBuilder { pub fn default_headers(self, headers: header::HeaderMap) -> ClientBuilder {
self.with_inner(move |inner| inner.default_headers(headers)) self.with_inner(move |inner| inner.default_headers(headers))
} }
@@ -215,13 +212,11 @@ impl ClientBuilder {
/// Enable auto gzip decompression by checking the ContentEncoding response header. /// Enable auto gzip decompression by checking the ContentEncoding response header.
/// ///
/// Default is enabled. /// Default is enabled.
#[inline]
pub fn gzip(self, enable: bool) -> ClientBuilder { pub fn gzip(self, enable: bool) -> ClientBuilder {
self.with_inner(|inner| inner.gzip(enable)) self.with_inner(|inner| inner.gzip(enable))
} }
/// Add a `Proxy` to the list of proxies the `Client` will use. /// Add a `Proxy` to the list of proxies the `Client` will use.
#[inline]
pub fn proxy(self, proxy: Proxy) -> ClientBuilder { pub fn proxy(self, proxy: Proxy) -> ClientBuilder {
self.with_inner(move |inner| inner.proxy(proxy)) self.with_inner(move |inner| inner.proxy(proxy))
} }
@@ -229,7 +224,6 @@ impl ClientBuilder {
/// Set a `RedirectPolicy` for this client. /// Set a `RedirectPolicy` for this client.
/// ///
/// Default will follow redirects up to a maximum of 10. /// Default will follow redirects up to a maximum of 10.
#[inline]
pub fn redirect(self, policy: RedirectPolicy) -> ClientBuilder { pub fn redirect(self, policy: RedirectPolicy) -> ClientBuilder {
self.with_inner(move |inner| inner.redirect(policy)) self.with_inner(move |inner| inner.redirect(policy))
} }
@@ -237,7 +231,6 @@ impl ClientBuilder {
/// Enable or disable automatic setting of the `Referer` header. /// Enable or disable automatic setting of the `Referer` header.
/// ///
/// Default is `true`. /// Default is `true`.
#[inline]
pub fn referer(self, enable: bool) -> ClientBuilder { pub fn referer(self, enable: bool) -> ClientBuilder {
self.with_inner(|inner| inner.referer(enable)) self.with_inner(|inner| inner.referer(enable))
} }
@@ -247,7 +240,6 @@ impl ClientBuilder {
/// Default is 30 seconds. /// Default is 30 seconds.
/// ///
/// Pass `None` to disable timeout. /// Pass `None` to disable timeout.
#[inline]
pub fn timeout<T>(mut self, timeout: T) -> ClientBuilder pub fn timeout<T>(mut self, timeout: T) -> ClientBuilder
where T: Into<Option<Duration>>, where T: Into<Option<Duration>>,
{ {
@@ -273,7 +265,6 @@ impl Client {
/// This method panics if native TLS backend cannot be created or /// This method panics if native TLS backend cannot be created or
/// initialized. Use `Client::builder()` if you wish to handle the failure /// initialized. Use `Client::builder()` if you wish to handle the failure
/// as an `Error` instead of panicking. /// as an `Error` instead of panicking.
#[inline]
pub fn new() -> Client { pub fn new() -> Client {
ClientBuilder::new() ClientBuilder::new()
.build() .build()
@@ -281,7 +272,6 @@ impl Client {
} }
/// Creates a `ClientBuilder` to configure a `Client`. /// Creates a `ClientBuilder` to configure a `Client`.
#[inline]
pub fn builder() -> ClientBuilder { pub fn builder() -> ClientBuilder {
ClientBuilder::new() ClientBuilder::new()
} }
@@ -503,7 +493,6 @@ impl ClientHandle {
struct Timeout(Option<Duration>); struct Timeout(Option<Duration>);
impl Default for Timeout { impl Default for Timeout {
#[inline]
fn default() -> Timeout { fn default() -> Timeout {
// default mentioned in ClientBuilder::timeout() doc comment // default mentioned in ClientBuilder::timeout() doc comment
Timeout(Some(Duration::from_secs(30))) Timeout(Some(Duration::from_secs(30)))