From 747bdb452bd77ca688c4601911ef998946595780 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Wed, 18 Jan 2023 10:19:25 -0500 Subject: [PATCH] fix: Add the standard lints to query_tests2 and fix the new warnings --- query_tests2/src/framework.rs | 4 ++-- query_tests2/src/lib.rs | 10 ++++++++++ test_helpers_end_to_end/src/steps.rs | 8 ++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/query_tests2/src/framework.rs b/query_tests2/src/framework.rs index e173c4da85..2586121e69 100644 --- a/query_tests2/src/framework.rs +++ b/query_tests2/src/framework.rs @@ -25,14 +25,14 @@ pub enum ChunkStage { } impl IntoIterator for ChunkStage { - type Item = ChunkStage; + type Item = Self; type IntoIter = std::vec::IntoIter; fn into_iter(self) -> Self::IntoIter { match self { // If `All` is specified, run the test twice, once with all chunks in the ingester and // then once with all chunks in Parquet. - ChunkStage::All => vec![ChunkStage::Ingester, ChunkStage::Parquet].into_iter(), + Self::All => vec![Self::Ingester, Self::Parquet].into_iter(), other => vec![other].into_iter(), } } diff --git a/query_tests2/src/lib.rs b/query_tests2/src/lib.rs index 7b20b6cfec..9465279126 100644 --- a/query_tests2/src/lib.rs +++ b/query_tests2/src/lib.rs @@ -1,3 +1,13 @@ +#![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)] +#![warn( + missing_debug_implementations, + clippy::explicit_iter_loop, + clippy::use_self, + clippy::clone_on_ref_ptr, + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro +)] #![cfg(test)] //! Tests of various queries for data in various states. diff --git a/test_helpers_end_to_end/src/steps.rs b/test_helpers_end_to_end/src/steps.rs index 5ab90eb818..0da34141a7 100644 --- a/test_helpers_end_to_end/src/steps.rs +++ b/test_helpers_end_to_end/src/steps.rs @@ -17,7 +17,7 @@ pub struct StepTest<'a, S> { cluster: &'a mut MiniCluster, /// The test steps to perform - steps: Box + 'a>, + steps: Box + Send + Sync + 'a>, } /// The test state that is passed to custom steps @@ -252,7 +252,11 @@ where { /// Create a new test that runs each `step`, in sequence, against /// `cluster` panic'ing if any step fails - pub fn new(cluster: &'a mut MiniCluster, steps: impl IntoIterator + 'a) -> Self { + pub fn new(cluster: &'a mut MiniCluster, steps: I) -> Self + where + I: IntoIterator + Send + Sync + 'a, + ::IntoIter: Send + Sync, + { Self { cluster, steps: Box::new(steps.into_iter()),