@@ -305,20 +305,20 @@ fn debug_formatting_millis() {
305
305
306
306
#[ test]
307
307
fn debug_formatting_micros ( ) {
308
- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_000 ) ) , "7µs " ) ;
309
- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_100 ) ) , "7.1µs " ) ;
310
- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_001 ) ) , "7.001µs " ) ;
311
- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_123 ) ) , "7.123µs " ) ;
308
+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_000 ) ) , "7μs " ) ;
309
+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_100 ) ) , "7.1μs " ) ;
310
+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_001 ) ) , "7.001μs " ) ;
311
+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_123 ) ) , "7.123μs " ) ;
312
312
313
- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_000 ) ) , "88µs " ) ;
314
- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_100 ) ) , "88.1µs " ) ;
315
- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_001 ) ) , "88.001µs " ) ;
316
- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_123 ) ) , "88.123µs " ) ;
313
+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_000 ) ) , "88μs " ) ;
314
+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_100 ) ) , "88.1μs " ) ;
315
+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_001 ) ) , "88.001μs " ) ;
316
+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_123 ) ) , "88.123μs " ) ;
317
317
318
- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_000 ) ) , "999µs " ) ;
319
- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_100 ) ) , "999.1µs " ) ;
320
- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_001 ) ) , "999.001µs " ) ;
321
- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_123 ) ) , "999.123µs " ) ;
318
+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_000 ) ) , "999μs " ) ;
319
+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_100 ) ) , "999.1μs " ) ;
320
+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_001 ) ) , "999.001μs " ) ;
321
+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_123 ) ) , "999.123μs " ) ;
322
322
}
323
323
324
324
#[ test]
@@ -334,10 +334,10 @@ fn debug_formatting_precision_zero() {
334
334
assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 0 ) ) , "0ns" ) ;
335
335
assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 123 ) ) , "123ns" ) ;
336
336
337
- assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_001 ) ) , "1µs " ) ;
338
- assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_499 ) ) , "1µs " ) ;
339
- assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_500 ) ) , "2µs " ) ;
340
- assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_999 ) ) , "2µs " ) ;
337
+ assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_001 ) ) , "1μs " ) ;
338
+ assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_499 ) ) , "1μs " ) ;
339
+ assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_500 ) ) , "2μs " ) ;
340
+ assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_999 ) ) , "2μs " ) ;
341
341
342
342
assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_000_001 ) ) , "1ms" ) ;
343
343
assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_499_999 ) ) , "1ms" ) ;
@@ -355,12 +355,12 @@ fn debug_formatting_precision_two() {
355
355
assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 0 ) ) , "0.00ns" ) ;
356
356
assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 123 ) ) , "123.00ns" ) ;
357
357
358
- assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 1_000 ) ) , "1.00µs " ) ;
359
- assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_001 ) ) , "7.00µs " ) ;
360
- assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_100 ) ) , "7.10µs " ) ;
361
- assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_109 ) ) , "7.11µs " ) ;
362
- assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_199 ) ) , "7.20µs " ) ;
363
- assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 1_999 ) ) , "2.00µs " ) ;
358
+ assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 1_000 ) ) , "1.00μs " ) ;
359
+ assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_001 ) ) , "7.00μs " ) ;
360
+ assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_100 ) ) , "7.10μs " ) ;
361
+ assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_109 ) ) , "7.11μs " ) ;
362
+ assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_199 ) ) , "7.20μs " ) ;
363
+ assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 1_999 ) ) , "2.00μs " ) ;
364
364
365
365
assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 1_000_000 ) ) , "1.00ms" ) ;
366
366
assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 3_001_000 ) ) , "3.00ms" ) ;
@@ -386,9 +386,9 @@ fn debug_formatting_padding() {
386
386
assert_eq ! ( "123.0ns " , format!( "{:<9.1?}" , Duration :: new( 0 , 123 ) ) ) ;
387
387
assert_eq ! ( " 123.0ns" , format!( "{:>9.1?}" , Duration :: new( 0 , 123 ) ) ) ;
388
388
assert_eq ! ( " 123.0ns " , format!( "{:^9.1?}" , Duration :: new( 0 , 123 ) ) ) ;
389
- assert_eq ! ( "7.1µs " , format!( "{:<9?}" , Duration :: new( 0 , 7_100 ) ) ) ;
390
- assert_eq ! ( " 7.1µs " , format!( "{:>9?}" , Duration :: new( 0 , 7_100 ) ) ) ;
391
- assert_eq ! ( " 7.1µs " , format!( "{:^9?}" , Duration :: new( 0 , 7_100 ) ) ) ;
389
+ assert_eq ! ( "7.1μs " , format!( "{:<9?}" , Duration :: new( 0 , 7_100 ) ) ) ;
390
+ assert_eq ! ( " 7.1μs " , format!( "{:>9?}" , Duration :: new( 0 , 7_100 ) ) ) ;
391
+ assert_eq ! ( " 7.1μs " , format!( "{:^9?}" , Duration :: new( 0 , 7_100 ) ) ) ;
392
392
assert_eq ! ( "999.123456ms" , format!( "{:<9?}" , Duration :: new( 0 , 999_123_456 ) ) ) ;
393
393
assert_eq ! ( "999.123456ms" , format!( "{:>9?}" , Duration :: new( 0 , 999_123_456 ) ) ) ;
394
394
assert_eq ! ( "999.123456ms" , format!( "{:^9?}" , Duration :: new( 0 , 999_123_456 ) ) ) ;
@@ -405,7 +405,7 @@ fn debug_formatting_padding() {
405
405
406
406
#[ test]
407
407
fn debug_formatting_precision_high ( ) {
408
- assert_eq ! ( format!( "{:.5?}" , Duration :: new( 0 , 23_678 ) ) , "23.67800µs " ) ;
408
+ assert_eq ! ( format!( "{:.5?}" , Duration :: new( 0 , 23_678 ) ) , "23.67800μs " ) ;
409
409
410
410
assert_eq ! ( format!( "{:.9?}" , Duration :: new( 1 , 000_000_000 ) ) , "1.000000000s" ) ;
411
411
assert_eq ! ( format!( "{:.10?}" , Duration :: new( 4 , 001_000_000 ) ) , "4.0010000000s" ) ;
0 commit comments