Skip to content
New issue

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

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

Already on GitHub? # to your account

chore: fix a number of newer clippy lints #2469

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/async_impl/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl ClientBuilder {
connect_timeout: None,
connection_verbose: false,
pool_idle_timeout: Some(Duration::from_secs(90)),
pool_max_idle_per_host: std::usize::MAX,
pool_max_idle_per_host: usize::MAX,
// TODO: Re-enable default duration once hyper's HttpConnector is fixed
// to no longer error when an option fails.
tcp_keepalive: None, //Some(Duration::from_secs(60)),
Expand Down
2 changes: 1 addition & 1 deletion src/dns/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl FromStr for Name {
type Err = sealed::InvalidNameError;

fn from_str(host: &str) -> Result<Self, Self::Err> {
HyperName::from_str(host.into())
HyperName::from_str(host)
.map(Name)
.map_err(|_| sealed::InvalidNameError { _ext: () })
}
Expand Down
2 changes: 1 addition & 1 deletion src/into_url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<'a> IntoUrlSealed for &'a String {
}
}

impl<'a> IntoUrlSealed for String {
impl IntoUrlSealed for String {
fn into_url(self) -> crate::Result<Url> {
(&*self).into_url()
}
Expand Down
15 changes: 6 additions & 9 deletions src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,11 @@ impl<S: IntoUrl> IntoProxyScheme for S {
let mut source = e.source();
while let Some(err) = source {
if let Some(parse_error) = err.downcast_ref::<url::ParseError>() {
match parse_error {
url::ParseError::RelativeUrlWithoutBase => {
presumed_to_have_scheme = false;
break;
}
_ => {}
if *parse_error == url::ParseError::RelativeUrlWithoutBase {
presumed_to_have_scheme = false;
break;
}
} else if let Some(_) = err.downcast_ref::<crate::error::BadScheme>() {
} else if err.downcast_ref::<crate::error::BadScheme>().is_some() {
presumed_to_have_scheme = false;
break;
}
Expand Down Expand Up @@ -456,10 +453,10 @@ impl NoProxy {
/// * If neither environment variable is set, `None` is returned
/// * Entries are expected to be comma-separated (whitespace between entries is ignored)
/// * IP addresses (both IPv4 and IPv6) are allowed, as are optional subnet masks (by adding /size,
/// for example "`192.168.1.0/24`").
/// for example "`192.168.1.0/24`").
/// * An entry "`*`" matches all hostnames (this is the only wildcard allowed)
/// * Any other entry is considered a domain name (and may contain a leading dot, for example `google.com`
/// and `.google.com` are equivalent) and would match both that domain AND all subdomains.
/// and `.google.com` are equivalent) and would match both that domain AND all subdomains.
///
/// For example, if `"NO_PROXY=google.com, 192.168.1.0/24"` was set, all of the following would match
/// (and therefore would bypass the proxy):
Expand Down
3 changes: 2 additions & 1 deletion src/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl Certificate {

Self::read_pem_certs(&mut reader)?
.iter()
.map(|cert_vec| Certificate::from_der(&cert_vec))
.map(|cert_vec| Certificate::from_der(cert_vec))
.collect::<crate::Result<Vec<Certificate>>>()
}

Expand Down Expand Up @@ -585,6 +585,7 @@ impl fmt::Debug for TlsBackend {
}
}

#[allow(clippy::derivable_impls)]
impl Default for TlsBackend {
fn default() -> TlsBackend {
#[cfg(all(feature = "default-tls", not(feature = "http3")))]
Expand Down