Skip to content

Commit

Permalink
[benchmark.rs] Change a fallible conversion to infallible to avoid a …
Browse files Browse the repository at this point in the history
…Clippy error.
  • Loading branch information
lgarron committed Sep 27, 2024
1 parent 9267c01 commit 5f38186
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rs/_cli/commands/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ pub fn benchmark(benchmark_args: &BenchmarkArgs) -> Result<(), CommandError> {
}
let end_time = Instant::now();
let elapsed = end_time - start_time;
let rate = std::convert::TryInto::<f64>::try_into(NUM_TEST_TRANSFORMATIONS as u32).unwrap()
let rate = std::convert::Into::<f64>::into(NUM_TEST_TRANSFORMATIONS as u32)
/ elapsed.as_secs_f64()
/ std::convert::TryInto::<f64>::try_into(ONE_MILLION).unwrap();
/ std::convert::Into::<f64>::into(ONE_MILLION);
println!(
"Took {:?} for {} transformations ({:.2}M moves/s)",
elapsed, NUM_TEST_TRANSFORMATIONS, rate
Expand Down

0 comments on commit 5f38186

Please sign in to comment.