diff options
author | Yuri Astrakhan <yuriastrakhan@gmail.com> | 2023-11-15 03:47:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-15 03:47:22 -0500 |
commit | 5eb4fbde5d7e41cd39dcb7c95e1bbf542e706cb0 (patch) | |
tree | 13b0ba47b78190b294b54d05eb4821306a6687f3 /src/canvas/widgets/network_graph.rs | |
parent | a6200640b9a074feb116b7808543c8cb73c8dd30 (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/canvas/widgets/network_graph.rs')
-rw-r--r-- | src/canvas/widgets/network_graph.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/canvas/widgets/network_graph.rs b/src/canvas/widgets/network_graph.rs index 5e6f71d1..5073fda6 100644 --- a/src/canvas/widgets/network_graph.rs +++ b/src/canvas/widgets/network_graph.rs @@ -413,13 +413,13 @@ fn adjust_network_data_point( let base_unit = max_value_scaled; let labels: Vec<String> = vec![ - format!("0{}{}", unit_prefix, unit_type), + format!("0{unit_prefix}{unit_type}"), format!("{:.1}", base_unit * 0.5), format!("{:.1}", base_unit), format!("{:.1}", base_unit * 1.5), ] .into_iter() - .map(|s| format!("{:>5}", s)) // Pull 5 as the longest legend value is generally going to be 5 digits (if they somehow hit over 5 terabits per second) + .map(|s| format!("{s:>5}")) // Pull 5 as the longest legend value is generally going to be 5 digits (if they somehow hit over 5 terabits per second) .collect(); (bumped_max_entry, labels) |