File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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> {
532532fn 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
You can’t perform that action at this time.
0 commit comments