Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporated range operator and collapsible_match #1214

Merged
merged 2 commits into from Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/connect.rs
Expand Up @@ -1005,7 +1005,7 @@ mod verbose {
} else if c == b'\0' {
write!(f, "\\0")?;
// ASCII printable
} else if c >= 0x20 && c < 0x7f {
} else if (0x20..0x7f).contains(&c) {
bishtpawan marked this conversation as resolved.
Show resolved Hide resolved
write!(f, "{}", c as char)?;
} else {
write!(f, "\\x{:02x}", c)?;
Expand Down
12 changes: 4 additions & 8 deletions src/proxy.rs
Expand Up @@ -279,11 +279,8 @@ impl Proxy {
// Custom *may* match 'http', so assume so.
| Intercept::Custom(_) => true,
Intercept::System(ref system) => {
if let Some(proxy) = system.get("http") {
match proxy {
ProxyScheme::Http { auth, .. } => auth.is_some(),
_ => false,
}
if let Some(ProxyScheme::Http { auth, .. }) = system.get("http") {
auth.is_some()
} else {
false
}
Expand Down Expand Up @@ -732,19 +729,18 @@ fn get_sys_proxies(
RegistryProxyValues,
>,
) -> SystemProxyMap {
let proxies = get_from_environment();

// TODO: move the following #[cfg] to `if expression` when attributes on `if` expressions allowed
#[cfg(target_os = "windows")]
{
let proxies = get_from_environment();
if proxies.is_empty() {
// don't care errors if can't get proxies from registry, just return an empty HashMap.
if let Some(registry_values) = registry_values {
return parse_registry_values(registry_values);
}
}
}
proxies
get_from_environment()
bishtpawan marked this conversation as resolved.
Show resolved Hide resolved
}

fn insert_proxy(proxies: &mut SystemProxyMap, scheme: impl Into<String>, addr: String) -> bool {
Expand Down