@@ -38,9 +38,7 @@ impl PartialEq for KdlValue {
3838 match ( self , other) {
3939 ( Self :: String ( l0) , Self :: String ( r0) ) => l0 == r0,
4040 ( Self :: Integer ( l0) , Self :: Integer ( r0) ) => l0 == r0,
41- ( Self :: Float ( l0) , Self :: Float ( r0) ) => {
42- normalize_float ( l0) == normalize_float ( r0)
43- }
41+ ( Self :: Float ( l0) , Self :: Float ( r0) ) => normalize_float ( l0) == normalize_float ( r0) ,
4442 ( Self :: Bool ( l0) , Self :: Bool ( r0) ) => l0 == r0,
4543 _ => core:: mem:: discriminant ( self ) == core:: mem:: discriminant ( other) ,
4644 }
@@ -161,11 +159,7 @@ pub(crate) fn is_plain_ident(ident: &str) -> bool {
161159 . find ( crate :: v2_parser:: is_disallowed_ident_char)
162160 . is_none ( )
163161 && ident_bytes. first ( ) . map ( |c| c. is_ascii_digit ( ) ) != Some ( true )
164- && !( ident
165- . chars ( )
166- . next ( )
167- . map ( |c| matches ! ( c, '.' | '-' | '+' ) )
168- == Some ( true )
162+ && !( ident. chars ( ) . next ( ) . map ( |c| matches ! ( c, '.' | '-' | '+' ) ) == Some ( true )
169163 && ident_bytes. get ( 1 ) . map ( |c| c. is_ascii_digit ( ) ) == Some ( true ) )
170164 && ident != "inf"
171165 && ident != "-inf"
@@ -272,18 +266,18 @@ mod test {
272266 #[ test]
273267 fn formatting ( ) {
274268 let string = KdlValue :: String ( "foo\n " . into ( ) ) ;
275- assert_eq ! ( format!( "{}" , string ) , r#""foo\n""# ) ;
269+ assert_eq ! ( format!( "{string}" ) , r#""foo\n""# ) ;
276270
277271 let integer = KdlValue :: Integer ( 1234567890 ) ;
278- assert_eq ! ( format!( "{}" , integer ) , "1234567890" ) ;
272+ assert_eq ! ( format!( "{integer}" ) , "1234567890" ) ;
279273
280274 let float = KdlValue :: Float ( 1234567890.12345 ) ;
281- assert_eq ! ( format!( "{}" , float ) , "1234567890.12345" ) ;
275+ assert_eq ! ( format!( "{float}" ) , "1234567890.12345" ) ;
282276
283277 let boolean = KdlValue :: Bool ( true ) ;
284- assert_eq ! ( format!( "{}" , boolean ) , "#true" ) ;
278+ assert_eq ! ( format!( "{boolean}" ) , "#true" ) ;
285279
286280 let null = KdlValue :: Null ;
287- assert_eq ! ( format!( "{}" , null ) , "#null" ) ;
281+ assert_eq ! ( format!( "{null}" ) , "#null" ) ;
288282 }
289283}
0 commit comments