Fixes:
warning: the loop variable `i` is used to index `time_data`
--> src/rrd_graph_new.rs:388:14
|
388 | for i in 0..time_data.len() {
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
= note: `#[warn(clippy::needless_range_loop)]` on by default
help: consider using an iterator and enumerate()
|
388 | for (i, <item>) in time_data.iter().enumerate() {
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
) -> String {
let mut path = String::new();
let mut last_undefined = true;
- for i in 0..time_data.len() {
- let t = time_data[i];
+ for (i, t) in time_data.iter().enumerate() {
let value = *values.get(i).unwrap_or(&f64::NAN);
- let x = compute_x(t);
+ let x = compute_x(*t);
if last_undefined {
if value.is_nan() {