diff --git a/Cargo.lock b/Cargo.lock index 6634cfc..c437248 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2281,7 +2281,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", - "itoa 1.0.10", + "itoa 1.0.11", "num-conv", "powerfmt", "serde", diff --git a/src/context.rs b/src/context.rs index 0def5d8..2faa5d6 100644 --- a/src/context.rs +++ b/src/context.rs @@ -660,7 +660,7 @@ impl Context { let deserialized: Value = rmp_serde::from_slice(&serialized)?; Ok(Context { session: self.session.clone(), - page_size: self.page_size.clone(), + page_size: self.page_size, statements: self.statements.clone(), stats: TryLock::new(SessionStats::default()), retry_number: self.retry_number, @@ -707,6 +707,7 @@ impl Context { } /// Creates a preset for uneven row distribution among partitions + #[allow(clippy::comparison_chain)] pub async fn init_partition_row_distribution_preset( &mut self, preset_name: &str, diff --git a/src/stats.rs b/src/stats.rs index 508dd7c..8567fab 100644 --- a/src/stats.rs +++ b/src/stats.rs @@ -727,15 +727,12 @@ mod test { fn random_vector(seed: usize, len: usize, mean: f64, std_dev: f64) -> Vec { let mut rng = StdRng::seed_from_u64(seed as u64); let distrib = Normal::new(mean, std_dev).unwrap(); - (0..len) - .into_iter() - .map(|_| distrib.sample(&mut rng) as f32) - .collect() + (0..len).map(|_| distrib.sample(&mut rng) as f32).collect() } /// Introduces a strong dependency between the observations, /// making it an AR(1) process - fn make_autocorrelated(v: &mut Vec) { + fn make_autocorrelated(v: &mut [f32]) { for i in 1..v.len() { v[i] = 0.01 * v[i] + 0.99 * v[i - 1]; }