update and tidy code

This commit is contained in:
Daniel Eades
2019-08-07 20:44:24 +01:00
committed by Sean McArthur
parent 86d9cbc66e
commit 5dc5162765
14 changed files with 46 additions and 55 deletions

View File

@@ -397,8 +397,7 @@ impl Custom {
uri.scheme(),
uri.host(),
uri.port().map(|_| ":").unwrap_or(""),
uri.port().map(|p| p.to_string()).unwrap_or(String::new())
)
uri.port().map(|p| p.to_string()).unwrap_or_default())
.parse()
.expect("should be valid Url");
@@ -517,7 +516,7 @@ fn get_from_environment() -> HashMap<String, Url> {
if key.ends_with(PROXY_KEY_ENDS) {
let end_indx = key.len() - PROXY_KEY_ENDS.len();
let schema = &key[..end_indx];
insert_proxy(&mut proxies, String::from(schema), String::from(value));
insert_proxy(&mut proxies, String::from(schema), value);
}
}
proxies