Skip to content

Commit

Permalink
Use Option::tanspose
Browse files Browse the repository at this point in the history
  • Loading branch information
kazk committed Feb 27, 2021
1 parent da2d9a3 commit bd33f55
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions kube/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,7 @@ impl TryFrom<Config> for Service {
#[cfg(not(feature = "proxy"))]
let conn = connector::https_connector(tls);
#[cfg(feature = "proxy")]
let conn = connector::proxy_connector(
tls,
if let Some(url) = &config.proxy_url {
Some(url.parse::<http::uri::Uri>()?)
} else {
None
},
);
let conn = connector::proxy_connector(tls, config.proxy_url.map(|s| s.parse()).transpose()?);

let conn = ServiceBuilder::new().layer(with_timeout).service(conn);
let client: HyperClient<_, Body> = HyperClient::builder().build(conn);
Expand Down

0 comments on commit bd33f55

Please sign in to comment.