@@ -533,40 +533,31 @@ impl Client {
533533 ErrorKind : From < E > ,
534534 {
535535 let Request {
536- ref mut uri,
536+ mut uri,
537537 credentials,
538538 source,
539539 span,
540540 ..
541541 } = request. try_into ( ) ?;
542542
543- let remapping = self . remap ( uri) ?;
544-
545- if self . is_excluded ( uri) {
546- return Ok ( Response :: new (
547- uri. clone ( ) ,
548- Status :: Excluded ,
549- source. into ( ) ,
550- span,
551- None ,
552- ) ) ;
553- }
554-
555543 let start = std:: time:: Instant :: now ( ) ; // Measure check time
544+ let remapping = self . remap ( & mut uri) ?;
556545
557- let mut status = match uri. scheme ( ) {
546+ let status = match uri. scheme ( ) {
547+ _ if self . is_excluded ( & uri) => Status :: Excluded ,
558548 _ if uri. is_tel ( ) => Status :: Excluded , // We don't check tel: URIs
559- _ if uri. is_file ( ) => self . check_file ( uri) . await ,
560- _ if uri. is_mail ( ) => self . check_mail ( uri) . await ,
561- _ => self . check_website ( uri, credentials) . await ?,
549+ _ if uri. is_file ( ) => self . check_file ( & uri) . await ,
550+ _ if uri. is_mail ( ) => self . check_mail ( & uri) . await ,
551+ _ => self . check_website ( & uri, credentials) . await ?,
562552 } ;
563553
564- if let Some ( remapping) = remapping {
565- status = Status :: Remapped ( Box :: new ( status) , remapping) ;
566- }
554+ let status = match remapping {
555+ Some ( remapping) => Status :: Remapped ( Box :: new ( status) , remapping) ,
556+ None => status,
557+ } ;
567558
568559 Ok ( Response :: new (
569- uri. clone ( ) ,
560+ uri,
570561 status,
571562 source. into ( ) ,
572563 span,
0 commit comments