From 841004b68cf7013a678fff8784a6fd3dd12f096a Mon Sep 17 00:00:00 2001 From: Zachary Dremann Date: Wed, 9 Oct 2024 21:04:22 -0400 Subject: [PATCH 1/2] Fix warnings when testing with nightly Keep testing arbitrary implementations as pub(crate). This avoids warnings about undocumented public APIs --- roaring/src/bitmap/arbitrary.rs | 2 +- roaring/src/treemap/arbitrary.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roaring/src/bitmap/arbitrary.rs b/roaring/src/bitmap/arbitrary.rs index a8ca25be..6bb8b356 100644 --- a/roaring/src/bitmap/arbitrary.rs +++ b/roaring/src/bitmap/arbitrary.rs @@ -189,7 +189,7 @@ mod test { impl RoaringBitmap { prop_compose! { - pub fn arbitrary()(bitmap in (0usize..=16).prop_flat_map(containers)) -> RoaringBitmap { + pub(crate) fn arbitrary()(bitmap in (0usize..=16).prop_flat_map(containers)) -> RoaringBitmap { bitmap } } diff --git a/roaring/src/treemap/arbitrary.rs b/roaring/src/treemap/arbitrary.rs index c7adb7d5..6c8e096a 100644 --- a/roaring/src/treemap/arbitrary.rs +++ b/roaring/src/treemap/arbitrary.rs @@ -6,7 +6,7 @@ mod test { impl RoaringTreemap { prop_compose! { - pub fn arbitrary()(map in btree_map(0u32..=16, RoaringBitmap::arbitrary(), 0usize..=16)) -> RoaringTreemap { + pub(crate) fn arbitrary()(map in btree_map(0u32..=16, RoaringBitmap::arbitrary(), 0usize..=16)) -> RoaringTreemap { // we’re NEVER supposed to start with a treemap containing empty bitmaps // Since we can’t configure this in arbitrary we’re simply going to ignore the generated empty bitmaps let map = map.into_iter().filter(|(_, v)| !v.is_empty()).collect(); From 55a0b18c71333e162654eeb2a80d24ee863d2c5a Mon Sep 17 00:00:00 2001 From: Zachary Dremann Date: Thu, 10 Oct 2024 20:45:13 -0400 Subject: [PATCH 2/2] Also fix clippy warnings on nightly --- roaring/src/bitmap/container.rs | 2 +- roaring/src/bitmap/store/mod.rs | 2 +- roaring/src/treemap/iter.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roaring/src/bitmap/container.rs b/roaring/src/bitmap/container.rs index 3ab1e5ad..09860b88 100644 --- a/roaring/src/bitmap/container.rs +++ b/roaring/src/bitmap/container.rs @@ -295,7 +295,7 @@ impl IntoIterator for Container { } } -impl<'a> Iterator for Iter<'a> { +impl Iterator for Iter<'_> { type Item = u32; fn next(&mut self) -> Option { self.inner.next().map(|i| util::join(self.key, i)) diff --git a/roaring/src/bitmap/store/mod.rs b/roaring/src/bitmap/store/mod.rs index bb0d5822..d0661639 100644 --- a/roaring/src/bitmap/store/mod.rs +++ b/roaring/src/bitmap/store/mod.rs @@ -497,7 +497,7 @@ impl PartialEq for Store { } } -impl<'a> Iterator for Iter<'a> { +impl Iterator for Iter<'_> { type Item = u16; fn next(&mut self) -> Option { diff --git a/roaring/src/treemap/iter.rs b/roaring/src/treemap/iter.rs index 96ccb00d..f8094a37 100644 --- a/roaring/src/treemap/iter.rs +++ b/roaring/src/treemap/iter.rs @@ -11,7 +11,7 @@ struct To64Iter<'a> { inner: Iter32<'a>, } -impl<'a> Iterator for To64Iter<'a> { +impl Iterator for To64Iter<'_> { type Item = u64; fn next(&mut self) -> Option { self.inner.next().map(|n| util::join(self.hi, n)) @@ -109,7 +109,7 @@ pub struct IntoIter { size_hint: u64, } -impl<'a> Iter<'a> { +impl Iter<'_> { fn new(map: &BTreeMap) -> Iter { let size_hint: u64 = map.iter().map(|(_, r)| r.len()).sum(); let i = map.iter().flat_map(to64iter as _); @@ -125,7 +125,7 @@ impl IntoIter { } } -impl<'a> Iterator for Iter<'a> { +impl Iterator for Iter<'_> { type Item = u64; fn next(&mut self) -> Option {