@@ -147,7 +147,7 @@ impl ProgUpdate {
147147 // Compute the throughput (bytes per second) as a string.
148148 let duration = self . duration . as_secs_f64 ( ) ;
149149 let safe_millis = std:: cmp:: max ( 1 , self . duration . as_millis ( ) ) ;
150- let rate = 1000 * ( btotal / safe_millis) ;
150+ let rate = 1000 * btotal / safe_millis;
151151 let transfer_rate = to_magnitude_and_suffix ( rate, SuffixType :: Si ) ;
152152
153153 // If we are rewriting the progress line, do write a carriage
@@ -644,15 +644,15 @@ mod tests {
644644 prog_update. write_prog_line ( & mut cursor, rewrite) . unwrap ( ) ;
645645 assert_eq ! (
646646 std:: str :: from_utf8( cursor. get_ref( ) ) . unwrap( ) ,
647- "1 byte copied, 1 s, 0 .0 B/s\n "
647+ "1 byte copied, 1 s, 1 .0 B/s\n "
648648 ) ;
649649
650650 let prog_update = prog_update_write ( 999 ) ;
651651 let mut cursor = Cursor :: new ( vec ! [ ] ) ;
652652 prog_update. write_prog_line ( & mut cursor, rewrite) . unwrap ( ) ;
653653 assert_eq ! (
654654 std:: str :: from_utf8( cursor. get_ref( ) ) . unwrap( ) ,
655- "999 bytes copied, 1 s, 0.0 B/s\n "
655+ "999 bytes copied, 1 s, 999 B/s\n "
656656 ) ;
657657
658658 let prog_update = prog_update_write ( 1000 ) ;
0 commit comments