1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-02 03:12:25 +01:00

inline format arguments

In a few cases, removed the unneeded `&` - this causes a minor slowdown because compiler cannot eliminate those (yet).
This commit is contained in:
Yuri Astrakhan
2025-02-27 00:30:05 -05:00
committed by Martin Nordholts
parent 9824090654
commit d9fbd18541
14 changed files with 32 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
println!("The square of {num:.2} is {result:.2}.");
}