@@ -80,9 +80,9 @@ pub fn introspect_schema(
8080 let error_message = match res. text ( ) {
8181 Ok ( msg) => match serde_json:: from_str :: < serde_json:: Value > ( & msg) {
8282 Ok ( json) => format ! ( "HTTP {}\n {}" , status, serde_json:: to_string_pretty( & json) ?) ,
83- Err ( _) => format ! ( "HTTP {}: {}" , status , msg ) ,
83+ Err ( _) => format ! ( "HTTP {status }: {msg}" ) ,
8484 } ,
85- Err ( _) => format ! ( "HTTP {}" , status ) ,
85+ Err ( _) => format ! ( "HTTP {status}" ) ,
8686 } ;
8787 return Err ( Error :: message ( error_message) ) ;
8888 }
@@ -113,8 +113,7 @@ impl FromStr for Header {
113113 // error: colon required for name/value pair
114114 if !input. contains ( ':' ) {
115115 return Err ( format ! (
116- "Invalid header input. A colon is required to separate the name and value. [{}]" ,
117- input
116+ "Invalid header input. A colon is required to separate the name and value. [{input}]"
118117 ) ) ;
119118 }
120119
@@ -126,16 +125,14 @@ impl FromStr for Header {
126125 // error: field name must be
127126 if name. is_empty ( ) {
128127 return Err ( format ! (
129- "Invalid header input. Field name is required before colon. [{}]" ,
130- input
128+ "Invalid header input. Field name is required before colon. [{input}]"
131129 ) ) ;
132130 }
133131
134132 // error: no whitespace in field name
135133 if name. split_whitespace ( ) . count ( ) > 1 {
136134 return Err ( format ! (
137- "Invalid header input. Whitespace not allowed in field name. [{}]" ,
138- input
135+ "Invalid header input. Whitespace not allowed in field name. [{input}]"
139136 ) ) ;
140137 }
141138
@@ -196,12 +193,7 @@ mod tests {
196193 let header = Header :: from_str ( input) ;
197194
198195 assert ! ( header. is_ok( ) , "Expected ok: [{}]" , input) ;
199- assert_eq ! (
200- header. unwrap( ) ,
201- * * expected,
202- "Expected equality: [{}]" ,
203- input
204- ) ;
196+ assert_eq ! ( header. unwrap( ) , * * expected, "Expected equality: [{input}]" ) ;
205197 }
206198 }
207199}
0 commit comments