Skip to content

Commit

Permalink
remove unnecessary to_string() clals
Browse files Browse the repository at this point in the history
  • Loading branch information
tao-guo committed Oct 22, 2023
1 parent 09f44b4 commit cd04303
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ let now = Instant::now();
log::info!("thread {i} bandwidth: {bandwidth}");
});
let total_bandwidth = Byte::from_bytes((DATA_SIZE / now.elapsed().as_secs()) as u128)
.get_appropriate_unit(true)
.to_string();
.get_appropriate_unit(true);
log::info!("Total bandwidth: {total_bandwidth}/s");
```

Expand Down
3 changes: 1 addition & 2 deletions examples/dd_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ fn main() -> MainResult {
log::info!("thread {i} bandwidth: {bandwidth}");
});
let total_bandwidth = Byte::from_bytes((DATA_SIZE / now.elapsed().as_secs()) as u128)
.get_appropriate_unit(true)
.to_string();
.get_appropriate_unit(true);
log::info!("Total bandwidth: {total_bandwidth}/s");

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ pub fn spawn_with_output(input: proc_macro::TokenStream) -> proc_macro::TokenStr

#[proc_macro]
#[proc_macro_error]
/// Logs a fatal message at the error level, and exit process
/// Log a fatal message at the error level, and exit process
///
/// e.g:
/// ```
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@
//! log::info!("thread {i} bandwidth: {bandwidth}");
//! });
//! let total_bandwidth = Byte::from_bytes((DATA_SIZE / now.elapsed().as_secs()) as u128)
//! .get_appropriate_unit(true)
//! .to_string();
//! .get_appropriate_unit(true);
//! log::info!("Total bandwidth: {total_bandwidth}/s");
//! # Ok::<(), std::io::Error>(())
//! ```
Expand Down

0 comments on commit cd04303

Please sign in to comment.