File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -298,8 +298,8 @@ mod tests {
298298 #[ test]
299299 fn precision ( ) {
300300 let size = ByteSize :: mib ( 1908 ) ;
301- assert_eq ! ( "1.9 GiB" . to_string( ) , format!( "{}" , size ) ) ;
302- assert_eq ! ( "2 GiB" . to_string( ) , format!( "{:.0}" , size ) ) ;
303- assert_eq ! ( "1.86328 GiB" . to_string( ) , format!( "{:.5}" , size ) ) ;
301+ assert_eq ! ( "1.9 GiB" . to_string( ) , format!( "{size}" ) ) ;
302+ assert_eq ! ( "2 GiB" . to_string( ) , format!( "{size :.0}" ) ) ;
303+ assert_eq ! ( "1.86328 GiB" . to_string( ) , format!( "{size :.5}" ) ) ;
304304 }
305305}
Original file line number Diff line number Diff line change @@ -463,7 +463,7 @@ mod tests {
463463
464464 #[ track_caller]
465465 fn assert_display ( expected : & str , b : ByteSize ) {
466- assert_eq ! ( expected, format!( "{}" , b ) ) ;
466+ assert_eq ! ( expected, format!( "{b}" ) ) ;
467467 }
468468
469469 #[ test]
Original file line number Diff line number Diff line change @@ -17,15 +17,11 @@ impl str::FromStr for ByteSize {
1717 match suffix. parse :: < Unit > ( ) {
1818 Ok ( u) => Ok ( Self ( ( v * u) as u64 ) ) ,
1919 Err ( error) => Err ( format ! (
20- "couldn't parse {:?} into a known SI unit, {}" ,
21- suffix, error
20+ "couldn't parse {suffix:?} into a known SI unit, {error}"
2221 ) ) ,
2322 }
2423 }
25- Err ( error) => Err ( format ! (
26- "couldn't parse {:?} into a ByteSize, {}" ,
27- value, error
28- ) ) ,
24+ Err ( error) => Err ( format ! ( "couldn't parse {value:?} into a ByteSize, {error}" ) ) ,
2925 }
3026 }
3127}
@@ -177,7 +173,7 @@ impl str::FromStr for Unit {
177173 "gi" | "gib" => Ok ( Self :: GibiByte ) ,
178174 "ti" | "tib" => Ok ( Self :: TebiByte ) ,
179175 "pi" | "pib" => Ok ( Self :: PebiByte ) ,
180- _ => Err ( format ! ( "couldn't parse unit of {:?}" , unit ) ) ,
176+ _ => Err ( format ! ( "couldn't parse unit of {unit :?}" ) ) ,
181177 }
182178 }
183179}
You can’t perform that action at this time.
0 commit comments