From 05bd60618bee913b8729d3cd2c36a513ba098e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 12 Nov 2024 11:35:15 +0100 Subject: [PATCH 1/2] Bump the MSRV to v1.67 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 73958355..d1cdfd10 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: - stable - beta - nightly - - 1.66.0 + - 1.67.0 env: RUSTFLAGS: "-C target-cpu=native -C opt-level=3" ROARINGRS_BENCH_OFFLINE: "true" From c3ef874388a0d48b24a443dd6d2cc9c31aa0ead9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 12 Nov 2024 11:48:37 +0100 Subject: [PATCH 2/2] Make clippy happy --- benchmarks/benches/lib.rs | 10 +++++----- roaring/src/bitmap/arbitrary.rs | 4 ++-- roaring/src/bitmap/inherent.rs | 5 ++--- roaring/src/bitmap/store/bitmap_store.rs | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/benchmarks/benches/lib.rs b/benchmarks/benches/lib.rs index b5c92882..34af68ba 100644 --- a/benchmarks/benches/lib.rs +++ b/benchmarks/benches/lib.rs @@ -26,7 +26,7 @@ fn pairwise_binary_op_matrix( mut op_assign_ref: impl FnMut(&mut RoaringBitmap, &RoaringBitmap), op_len: impl Fn(&RoaringBitmap, &RoaringBitmap) -> u64, ) { - let mut group = c.benchmark_group(format!("pairwise_{}", op_name)); + let mut group = c.benchmark_group(format!("pairwise_{op_name}")); for dataset in Datasets { let pairs = dataset.bitmaps.iter().cloned().tuple_windows::<(_, _)>().collect::>(); @@ -652,7 +652,7 @@ fn insert_range_bitmap(c: &mut Criterion) { for &size in &[10, 100, 1_000, 5_000, 10_000, 20_000] { let mut group = c.benchmark_group("insert_range"); group.throughput(criterion::Throughput::Elements(size as u64)); - group.bench_function(format!("from_empty_{}", size), |b| { + group.bench_function(format!("from_empty_{size}"), |b| { let bm = RoaringBitmap::new(); b.iter_batched( || bm.clone(), @@ -660,7 +660,7 @@ fn insert_range_bitmap(c: &mut Criterion) { criterion::BatchSize::SmallInput, ) }); - group.bench_function(format!("pre_populated_{}", size), |b| { + group.bench_function(format!("pre_populated_{size}"), |b| { let mut bm = RoaringBitmap::new(); bm.insert_range(0..size); b.iter_batched( @@ -676,7 +676,7 @@ fn insert_range_treemap(c: &mut Criterion) { for &size in &[1_000_u64, 10_000u64, 2 * (u32::MAX as u64)] { let mut group = c.benchmark_group("insert_range_treemap"); group.throughput(criterion::Throughput::Elements(size)); - group.bench_function(format!("from_empty_{}", size), |b| { + group.bench_function(format!("from_empty_{size}"), |b| { let bm = RoaringTreemap::new(); b.iter_batched( || bm.clone(), @@ -684,7 +684,7 @@ fn insert_range_treemap(c: &mut Criterion) { criterion::BatchSize::SmallInput, ) }); - group.bench_function(format!("pre_populated_{}", size), |b| { + group.bench_function(format!("pre_populated_{size}"), |b| { let mut bm = RoaringTreemap::new(); bm.insert_range(0..size); b.iter_batched( diff --git a/roaring/src/bitmap/arbitrary.rs b/roaring/src/bitmap/arbitrary.rs index 6bb8b356..e71740f8 100644 --- a/roaring/src/bitmap/arbitrary.rs +++ b/roaring/src/bitmap/arbitrary.rs @@ -158,8 +158,8 @@ mod test { impl Debug for Store { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { match self { - Store::Array(a) => write!(f, "Store({:?})", a), - Store::Bitmap(b) => write!(f, "Store({:?})", b), + Store::Array(a) => write!(f, "Store({a:?})"), + Store::Bitmap(b) => write!(f, "Store({b:?})"), } } } diff --git a/roaring/src/bitmap/inherent.rs b/roaring/src/bitmap/inherent.rs index 559b7579..59e0e0fa 100644 --- a/roaring/src/bitmap/inherent.rs +++ b/roaring/src/bitmap/inherent.rs @@ -693,7 +693,7 @@ mod tests { // Assert all values in the range are present for i in r.clone() { - assert!(b.contains(i), "does not contain {}", i); + assert!(b.contains(i), "does not contain {i}"); } // Run the check values looking for any false positives @@ -702,8 +702,7 @@ mod tests { let range_has = r.contains(&i); assert_eq!( bitmap_has, range_has, - "value {} in bitmap={} and range={}", - i, bitmap_has, range_has + "value {i} in bitmap={bitmap_has} and range={range_has}" ); } } diff --git a/roaring/src/bitmap/store/bitmap_store.rs b/roaring/src/bitmap/store/bitmap_store.rs index 91b432bc..aaeb99d6 100644 --- a/roaring/src/bitmap/store/bitmap_store.rs +++ b/roaring/src/bitmap/store/bitmap_store.rs @@ -394,7 +394,7 @@ impl Display for Error { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { match self.kind { ErrorKind::Cardinality { expected, actual } => { - write!(f, "Expected cardinality was {} but was {}", expected, actual) + write!(f, "Expected cardinality was {expected} but was {actual}") } } }