Skip to content

Commit 76cf405

Browse files
committed
clippy-fix
1 parent cba758c commit 76cf405

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ impl<C> ProxyConnector<C> {
383383
/// These headers must be appended to the hyper Request for the proxy to work properly.
384384
/// This is needed only for http requests.
385385
pub fn http_headers(&self, uri: &Uri) -> Option<&HeaderMap> {
386-
if uri.scheme_str().map_or(true, |s| s != "http") {
386+
if uri.scheme_str() != Some("http") {
387387
return None;
388388
}
389389

@@ -532,9 +532,8 @@ fn proxy_dst(dst: &Uri, proxy: &Uri) -> io::Result<Uri> {
532532
fn extract_user_pass(uri: &Uri) -> Option<(&str, &str)> {
533533
let authority = uri.authority()?.as_str();
534534
let (userinfo, _) = authority.rsplit_once('@')?;
535-
let mut parts = userinfo.splitn(2, ':');
536-
let username = parts.next()?;
537-
let password = parts.next()?;
535+
let (username, password) = userinfo.split_once(':')?;
536+
538537
Some((username, password))
539538
}
540539

0 commit comments

Comments
 (0)