@@ -141,9 +141,9 @@ impl ClientBuilder {
141141
142142 /// Set the Authorization header with the calculated basic authentication value.
143143 pub fn basic_auth ( self , username : & str , password : & str ) -> Result < ClientBuilder > {
144- let auth = format ! ( "{}:{}" , username , password ) ;
144+ let auth = format ! ( "{username }:{password}" ) ;
145145 let encoded = BASE64_STANDARD . encode ( auth) ;
146- let value = format ! ( "Basic {}" , encoded ) ;
146+ let value = format ! ( "Basic {encoded}" ) ;
147147
148148 self . header ( "Authorization" , & value)
149149 }
@@ -477,7 +477,7 @@ where
477477 }
478478 StateProj :: Connecting { retry, resp } => match ready ! ( resp. poll( cx) ) {
479479 Ok ( resp) => {
480- debug ! ( "HTTP response: {:#?}" , resp ) ;
480+ debug ! ( "HTTP response: {resp :#?}" ) ;
481481
482482 if resp. status ( ) . is_success ( ) {
483483 self . as_mut ( ) . project ( ) . retry_strategy . reset ( Instant :: now ( ) ) ;
@@ -544,7 +544,7 @@ where
544544 }
545545 Err ( e) => {
546546 // This happens when the server is unreachable, e.g. connection refused.
547- warn ! ( "request returned an error: {}" , e ) ;
547+ warn ! ( "request returned an error: {e}" ) ;
548548 if !* retry {
549549 self . as_mut ( ) . project ( ) . state . set ( State :: StreamClosed ) ;
550550 return Poll :: Ready ( Some ( Err ( Error :: HttpStream ( Box :: new ( e) ) ) ) ) ;
@@ -645,7 +645,7 @@ fn uri_from_header(maybe_header: &Option<HeaderValue>) -> Result<Uri> {
645645}
646646
647647fn delay ( dur : Duration , description : & str ) -> Sleep {
648- info ! ( "Waiting {:?} before {}" , dur , description ) ;
648+ info ! ( "Waiting {dur :?} before {description}" ) ;
649649 tokio:: time:: sleep ( dur)
650650}
651651
@@ -679,7 +679,7 @@ mod tests {
679679 . expect ( "failed to add authentication" ) ;
680680
681681 let actual = builder. headers . get ( "Authorization" ) ;
682- let expected = HeaderValue :: from_str ( format ! ( "Basic {}" , expected ) . as_str ( ) )
682+ let expected = HeaderValue :: from_str ( format ! ( "Basic {expected}" ) . as_str ( ) )
683683 . expect ( "unable to create expected header" ) ;
684684
685685 assert_eq ! ( Some ( & expected) , actual) ;
@@ -697,7 +697,7 @@ mod tests {
697697 ReconnectOptionsBuilder , ReconnectingRequest ,
698698 } ;
699699
700- const INVALID_URI : & ' static str = "http://mycrazyunexsistenturl.invaliddomainext" ;
700+ const INVALID_URI : & str = "http://mycrazyunexsistenturl.invaliddomainext" ;
701701
702702 #[ test_case( INVALID_URI , false , |state| matches!( state, State :: StreamClosed ) ) ]
703703 #[ test_case( INVALID_URI , true , |state| matches!( state, State :: WaitingToReconnect ( _) ) ) ]
0 commit comments