Remove unnecessary Result returns.
This commit is contained in:
@@ -221,7 +221,7 @@ impl ClientBuilder {
|
||||
proxies.clone(),
|
||||
user_agent(&config.headers),
|
||||
config.local_address,
|
||||
config.nodelay)?
|
||||
config.nodelay)
|
||||
},
|
||||
#[cfg(feature = "rustls-tls")]
|
||||
TlsBackend::BuiltRustls(conn) => {
|
||||
@@ -231,7 +231,7 @@ impl ClientBuilder {
|
||||
proxies.clone(),
|
||||
user_agent(&config.headers),
|
||||
config.local_address,
|
||||
config.nodelay)?
|
||||
config.nodelay)
|
||||
},
|
||||
#[cfg(feature = "rustls-tls")]
|
||||
TlsBackend::Rustls => {
|
||||
@@ -266,7 +266,7 @@ impl ClientBuilder {
|
||||
user_agent(&config.headers),
|
||||
config.local_address,
|
||||
config.nodelay,
|
||||
)?
|
||||
)
|
||||
},
|
||||
#[cfg(any(
|
||||
feature = "native-tls",
|
||||
@@ -280,7 +280,7 @@ impl ClientBuilder {
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "__tls"))]
|
||||
Connector::new(http, proxies.clone(), config.local_address, config.nodelay)?
|
||||
Connector::new(http, proxies.clone(), config.local_address, config.nodelay)
|
||||
};
|
||||
|
||||
connector.set_timeout(config.connect_timeout);
|
||||
|
||||
@@ -137,18 +137,18 @@ impl Connector {
|
||||
proxies: Arc<Vec<Proxy>>,
|
||||
local_addr: T,
|
||||
nodelay: bool,
|
||||
) -> crate::Result<Connector>
|
||||
) -> Connector
|
||||
where
|
||||
T: Into<Option<IpAddr>>,
|
||||
{
|
||||
http.set_local_address(local_addr.into());
|
||||
http.set_nodelay(nodelay);
|
||||
Ok(Connector {
|
||||
Connector {
|
||||
inner: Inner::Http(http),
|
||||
verbose: verbose::OFF,
|
||||
proxies,
|
||||
timeout: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "default-tls")]
|
||||
@@ -164,14 +164,14 @@ impl Connector {
|
||||
T: Into<Option<IpAddr>>,
|
||||
{
|
||||
let tls = tls.build().map_err(crate::error::builder)?;
|
||||
Self::from_built_default_tls(
|
||||
Ok(Self::from_built_default_tls(
|
||||
http,
|
||||
tls,
|
||||
proxies,
|
||||
user_agent,
|
||||
local_addr,
|
||||
nodelay,
|
||||
)
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(feature = "default-tls")]
|
||||
@@ -181,21 +181,21 @@ impl Connector {
|
||||
proxies: Arc<Vec<Proxy>>,
|
||||
user_agent: Option<HeaderValue>,
|
||||
local_addr: T,
|
||||
nodelay: bool) -> crate::Result<Connector>
|
||||
nodelay: bool) -> Connector
|
||||
where
|
||||
T: Into<Option<IpAddr>>,
|
||||
{
|
||||
http.set_local_address(local_addr.into());
|
||||
http.enforce_http(false);
|
||||
|
||||
Ok(Connector {
|
||||
Connector {
|
||||
inner: Inner::DefaultTls(http, tls),
|
||||
proxies,
|
||||
verbose: verbose::OFF,
|
||||
timeout: None,
|
||||
nodelay,
|
||||
user_agent,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "rustls-tls")]
|
||||
@@ -206,7 +206,7 @@ impl Connector {
|
||||
user_agent: Option<HeaderValue>,
|
||||
local_addr: T,
|
||||
nodelay: bool,
|
||||
) -> crate::Result<Connector>
|
||||
) -> Connector
|
||||
where
|
||||
T: Into<Option<IpAddr>>,
|
||||
{
|
||||
@@ -222,7 +222,7 @@ impl Connector {
|
||||
(Arc::new(tls), Arc::new(tls_proxy))
|
||||
};
|
||||
|
||||
Ok(Connector {
|
||||
Connector {
|
||||
inner: Inner::RustlsTls {
|
||||
http,
|
||||
tls,
|
||||
@@ -233,7 +233,7 @@ impl Connector {
|
||||
timeout: None,
|
||||
nodelay,
|
||||
user_agent,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn set_timeout(&mut self, timeout: Option<Duration>) {
|
||||
|
||||
Reference in New Issue
Block a user