Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
(cherry picked from commit 0589df7)

Upd:
- Added more clippy fixes for the fork-specific code.
  • Loading branch information
pkolaczk authored and vponomaryov committed Oct 29, 2024
1 parent 97fd5b4 commit f477309
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 2 additions & 5 deletions src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,15 +727,12 @@ mod test {
fn random_vector(seed: usize, len: usize, mean: f64, std_dev: f64) -> Vec<f32> {
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<f32>) {
fn make_autocorrelated(v: &mut [f32]) {
for i in 1..v.len() {
v[i] = 0.01 * v[i] + 0.99 * v[i - 1];
}
Expand Down

0 comments on commit f477309

Please sign in to comment.