mirror of
https://github.com/ClementTsang/bottom.git
synced 2026-05-05 22:40:46 +00:00
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:
@@ -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)),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user