From 9f61270151adb88f1610881bbf570a0c7fe936d0 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Thu, 24 Aug 2023 15:28:19 +0700 Subject: [PATCH] clippy: `zip` takes `IntoIterator`. (#709) --- plot/src/axis.rs | 2 +- src/csv_report.rs | 2 +- src/html/mod.rs | 2 +- src/plot/plotters_backend/summary.rs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plot/src/axis.rs b/plot/src/axis.rs index 142c7fbda..4f068b155 100644 --- a/plot/src/axis.rs +++ b/plot/src/axis.rs @@ -140,7 +140,7 @@ where let pairs = positions .into_iter() - .zip(labels.into_iter()) + .zip(labels) .map(|(pos, label)| format!("'{}' {}", label.as_ref(), pos.f64())) .collect::>(); diff --git a/src/csv_report.rs b/src/csv_report.rs index f8e2a05f7..18c608b19 100644 --- a/src/csv_report.rs +++ b/src/csv_report.rs @@ -41,7 +41,7 @@ impl CsvReportWriter { }; let throughput_num = throughput_num.as_deref(); - for (count, measured_value) in data.iter_counts().iter().zip(data_scaled.into_iter()) { + for (count, measured_value) in data.iter_counts().iter().zip(data_scaled) { let row = CsvRow { group, function, diff --git a/src/html/mod.rs b/src/html/mod.rs index eb31a8168..996ffaa3b 100644 --- a/src/html/mod.rs +++ b/src/html/mod.rs @@ -721,7 +721,7 @@ impl Html { try_else_return!(fs::load(&entry.join("sample.json")), || None); let avg_times = iters .into_iter() - .zip(times.into_iter()) + .zip(times) .map(|(iters, time)| time / iters) .collect::>(); diff --git a/src/plot/plotters_backend/summary.rs b/src/plot/plotters_backend/summary.rs index 0ebb851e2..12cd8474a 100644 --- a/src/plot/plotters_backend/summary.rs +++ b/src/plot/plotters_backend/summary.rs @@ -86,11 +86,11 @@ fn draw_line_comarision_figure, YR: AsRangedCoord .draw() .unwrap(); - for (id, (name, xs, ys)) in (0..).zip(data.into_iter()) { + for (id, (name, xs, ys)) in (0..).zip(data) { let series = chart .draw_series( LineSeries::new( - xs.into_iter().zip(ys.into_iter()), + xs.into_iter().zip(ys), COMPARISON_COLORS[id % NUM_COLORS].filled(), ) .point_size(POINT_SIZE),