diff --git a/src/async_impl/client.rs b/src/async_impl/client.rs index b9b672f..24d2433 100644 --- a/src/async_impl/client.rs +++ b/src/async_impl/client.rs @@ -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); diff --git a/src/connect.rs b/src/connect.rs index c88a846..f52a978 100644 --- a/src/connect.rs +++ b/src/connect.rs @@ -137,18 +137,18 @@ impl Connector { proxies: Arc>, local_addr: T, nodelay: bool, - ) -> crate::Result + ) -> Connector where T: Into>, { 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>, { 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>, user_agent: Option, local_addr: T, - nodelay: bool) -> crate::Result + nodelay: bool) -> Connector where T: Into>, { 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, local_addr: T, nodelay: bool, - ) -> crate::Result + ) -> Connector where T: Into>, { @@ -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) {