[pdm-devel] [PATCH proxmox-yew-comp 08/15] use *= operator for assigments

Maximiliano Sandoval m.sandoval at proxmox.com
Mon Jan 13 15:27:18 CET 2025


Fixes:

warning: manual implementation of an assign operation
   --> src/rrd_graph_new.rs:261:9
    |
261 |         l = l * 2;
    |         ^^^^^^^^^ help: replace it with: `l *= 2`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 src/rrd_graph_new.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/rrd_graph_new.rs b/src/rrd_graph_new.rs
index 426dc61..0b08e08 100644
--- a/src/rrd_graph_new.rs
+++ b/src/rrd_graph_new.rs
@@ -188,9 +188,9 @@ fn get_grid_unit_base10(min: f64, max: f64) -> f64 {
     let count = range / res;
 
     if count > 15.0 {
-        res = res * 5.0;
+        res *= 5.0;
     } else if count > 10.0 {
-        res = res * 2.0;
+        res *= 2.0;
     }
 
     res
@@ -214,7 +214,7 @@ fn get_grid_unit_base2(min: f64, max: f64) -> f64 {
     let count = range / res;
 
     if count > 15.0 {
-        res = res * 2.0;
+        res *= 2.0;
     }
 
     res
@@ -258,7 +258,7 @@ fn get_time_grid_unit(min: i64, max: i64) -> i64 {
     }
 
     while (l >= *units.first().unwrap()) && (range / l) > 10 {
-        l = l * 2;
+        l *= 2;
     }
 
     //log::info!("TIMERANG {l}");
-- 
2.39.5





More information about the pdm-devel mailing list