From 81ed3ccc0d290211858e3b3587790ceb710327e7 Mon Sep 17 00:00:00 2001 From: David Himmelstrup Date: Sat, 2 Jul 2022 13:38:46 +0200 Subject: [PATCH] Apply clippy suggestions for rust-1.62 (#591) --- benches/benchmarks/iter_with_large_setup.rs | 5 +---- benches/benchmarks/iter_with_setup.rs | 5 +---- plot/src/axis.rs | 3 +++ plot/src/candlestick.rs | 3 +++ plot/src/curve.rs | 3 +++ plot/src/errorbar.rs | 3 +++ plot/src/filledcurve.rs | 3 +++ plot/src/key.rs | 3 +++ plot/src/lib.rs | 3 +++ src/benchmark.rs | 5 +++-- src/benchmark_group.rs | 4 ++-- src/connection.rs | 2 +- src/lib.rs | 6 +++--- src/plot/plotters_backend/summary.rs | 1 - src/report.rs | 4 ++-- 15 files changed, 34 insertions(+), 19 deletions(-) diff --git a/benches/benchmarks/iter_with_large_setup.rs b/benches/benchmarks/iter_with_large_setup.rs index 217d27151..b4d53ab55 100644 --- a/benches/benchmarks/iter_with_large_setup.rs +++ b/benches/benchmarks/iter_with_large_setup.rs @@ -10,10 +10,7 @@ fn large_setup(c: &mut Criterion) { "iter_with_large_setup", Benchmark::new("large_setup", |b| { // NOTE: iter_with_large_setup is deprecated. Use iter_batched instead. - b.iter_with_large_setup( - || (0..SIZE).map(|i| i as u8).collect::>(), - |v| v.clone(), - ) + b.iter_with_large_setup(|| (0..SIZE).map(|i| i as u8).collect::>(), |v| v) }) .throughput(Throughput::Bytes(SIZE as u64)), ); diff --git a/benches/benchmarks/iter_with_setup.rs b/benches/benchmarks/iter_with_setup.rs index 0f870634a..e65495ca4 100644 --- a/benches/benchmarks/iter_with_setup.rs +++ b/benches/benchmarks/iter_with_setup.rs @@ -4,10 +4,7 @@ const SIZE: usize = 1024 * 1024; fn setup(c: &mut Criterion) { c.bench_function("iter_with_setup", |b| { - b.iter_with_setup( - || (0..SIZE).map(|i| i as u8).collect::>(), - |v| v.clone(), - ) + b.iter_with_setup(|| (0..SIZE).map(|i| i as u8).collect::>(), |v| v) }); } diff --git a/plot/src/axis.rs b/plot/src/axis.rs index 97fd0cbea..142c7fbda 100644 --- a/plot/src/axis.rs +++ b/plot/src/axis.rs @@ -155,6 +155,9 @@ where } impl<'a> Script for (Axis, &'a Properties) { + // Allow clippy::format_push_string even with older versions of rust (<1.62) which + // don't have it defined. + #[allow(clippy::all)] fn script(&self) -> String { let &(axis, properties) = self; let axis_ = axis.display(); diff --git a/plot/src/candlestick.rs b/plot/src/candlestick.rs index e0a5cbebc..d1754e8c5 100644 --- a/plot/src/candlestick.rs +++ b/plot/src/candlestick.rs @@ -27,6 +27,9 @@ impl Default for Properties { } impl Script for Properties { + // Allow clippy::format_push_string even with older versions of rust (<1.62) which + // don't have it defined. + #[allow(clippy::all)] fn script(&self) -> String { let mut script = String::from("with candlesticks "); diff --git a/plot/src/curve.rs b/plot/src/curve.rs index bbddeff1a..a5766ee56 100644 --- a/plot/src/curve.rs +++ b/plot/src/curve.rs @@ -38,6 +38,9 @@ impl CurveDefault