Skip to content

Commit dbb04a1

Browse files
committed
fixed dd_test display regression
Need to call to_string() explicity for custom type now.
1 parent 6296d95 commit dbb04a1

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ let now = Instant::now();
5454
.unwrap_or_else(|_| cmd_die!("thread $i failed"));
5555
cmd_info!("thread $i bandwidth: $bandwidth");
5656
});
57-
let total_bandwidth =
58-
Byte::from_bytes((DATA_SIZE / now.elapsed().as_secs()) as u128).get_appropriate_unit(true);
57+
let total_bandwidth = Byte::from_bytes((DATA_SIZE / now.elapsed().as_secs()) as u128)
58+
.get_appropriate_unit(true)
59+
.to_string();
5960
cmd_info!("Total bandwidth: ${total_bandwidth}/s");
6061
```
6162

examples/dd_test.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ fn main() -> CmdResult {
5757
.unwrap_or_else(|_| cmd_die!("thread $i failed"));
5858
cmd_info!("thread $i bandwidth: $bandwidth");
5959
});
60-
let total_bandwidth =
61-
Byte::from_bytes((DATA_SIZE / now.elapsed().as_secs()) as u128).get_appropriate_unit(true);
60+
let total_bandwidth = Byte::from_bytes((DATA_SIZE / now.elapsed().as_secs()) as u128)
61+
.get_appropriate_unit(true)
62+
.to_string();
6263
cmd_info!("Total bandwidth: ${total_bandwidth}/s");
6364

6465
Ok(())

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@
6060
//! .unwrap_or_else(|_| cmd_die!("thread $i failed"));
6161
//! cmd_info!("thread $i bandwidth: $bandwidth");
6262
//! });
63-
//! let total_bandwidth =
64-
//! Byte::from_bytes((DATA_SIZE / now.elapsed().as_secs()) as u128).get_appropriate_unit(true);
63+
//! let total_bandwidth = Byte::from_bytes((DATA_SIZE / now.elapsed().as_secs()) as u128)
64+
//! .get_appropriate_unit(true)
65+
//! .to_string();
6566
//! cmd_info!("Total bandwidth: ${total_bandwidth}/s");
6667
//! # Ok::<(), std::io::Error>(())
6768
//! ```

0 commit comments

Comments
 (0)