chore: fix certain uninlined string format uses (#1310)

* Fixed uninlined args

First ran this, and fixed a few more similar issues by hand

```
cargo clippy --workspace --fix --benches --tests --bins -- -A clippy::all -W clippy::uninlined_format_args
```

Note that in a few cases, format args were passed by ref - which is actually a tiny perf hit - compiler would not be able to optimize them.

* revert change here

since it contains a non-inlineable variable I'm not a fan of using it partially here

* revert

given the other formats above/below I would prefer keeping it like this

---------

Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
This commit is contained in:
Yuri Astrakhan
2023-11-15 03:47:22 -05:00
committed by GitHub
parent a6200640b9
commit 5eb4fbde5d
18 changed files with 46 additions and 58 deletions
@@ -101,7 +101,7 @@ impl PartialOrd for MemUsage {
impl Display for MemUsage {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
MemUsage::Percent(percent) => f.write_fmt(format_args!("{:.1}%", percent)),
MemUsage::Percent(percent) => f.write_fmt(format_args!("{percent:.1}%")),
MemUsage::Bytes(bytes) => f.write_str(&binary_byte_string(*bytes)),
}
}