fix: Add the standard lints to query_tests2 and fix the new warnings

pull/24376/head
Carol (Nichols || Goulding) 2023-01-18 10:19:25 -05:00
parent f81debc0e4
commit 747bdb452b
No known key found for this signature in database
GPG Key ID: E907EE5A736F87D4
3 changed files with 18 additions and 4 deletions

View File

@ -25,14 +25,14 @@ pub enum ChunkStage {
}
impl IntoIterator for ChunkStage {
type Item = ChunkStage;
type Item = Self;
type IntoIter = std::vec::IntoIter<Self::Item>;
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(),
}
}

View File

@ -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.

View File

@ -17,7 +17,7 @@ pub struct StepTest<'a, S> {
cluster: &'a mut MiniCluster,
/// The test steps to perform
steps: Box<dyn Iterator<Item = S> + 'a>,
steps: Box<dyn Iterator<Item = S> + 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<Item = S> + 'a) -> Self {
pub fn new<I>(cluster: &'a mut MiniCluster, steps: I) -> Self
where
I: IntoIterator<Item = S> + Send + Sync + 'a,
<I as IntoIterator>::IntoIter: Send + Sync,
{
Self {
cluster,
steps: Box::new(steps.into_iter()),