[pdm-devel] [PATCH proxmox-yew-comp 13/15] use len() instead of length comparison to zero

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


Fixes:

warning: length comparison to zero
   --> src/rrd_graph_new.rs:660:22
    |
660 |                 _ if data0.len() == 0 => {}
    |                      ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `data0.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
    = note: `#[warn(clippy::len_zero)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 src/rrd_graph_new.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rrd_graph_new.rs b/src/rrd_graph_new.rs
index f549c4f..21890a1 100644
--- a/src/rrd_graph_new.rs
+++ b/src/rrd_graph_new.rs
@@ -654,7 +654,7 @@ impl PwtRRDGraph {
                             .into(),
                     );
                 }
-                _ if data0.len() == 0 => {}
+                _ if data0.is_empty() => {}
                 _ => log::debug!("out of bound selection start {start}, end {end} for {data0:?}"),
             }
         }
-- 
2.39.5





More information about the pdm-devel mailing list