summaryrefslogtreecommitdiffstats
path: root/src/widgets/process_table/proc_widget_data.rs
diff options
context:
space:
mode:
authorYuri Astrakhan <yuriastrakhan@gmail.com>2023-11-15 03:47:22 -0500
committerGitHub <noreply@github.com>2023-11-15 03:47:22 -0500
commit5eb4fbde5d7e41cd39dcb7c95e1bbf542e706cb0 (patch)
tree13b0ba47b78190b294b54d05eb4821306a6687f3 /src/widgets/process_table/proc_widget_data.rs
parenta6200640b9a074feb116b7808543c8cb73c8dd30 (diff)
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>
Diffstat (limited to 'src/widgets/process_table/proc_widget_data.rs')
-rw-r--r--src/widgets/process_table/proc_widget_data.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/process_table/proc_widget_data.rs b/src/widgets/process_table/proc_widget_data.rs
index 925bbe65..418d9997 100644
--- a/src/widgets/process_table/proc_widget_data.rs
+++ b/src/widgets/process_table/proc_widget_data.rs
@@ -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)),
}
}