Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make nightly clippy happy #261

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/treemap/inherent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl RoaringTreemap {
/// ```
pub fn insert(&mut self, value: u64) -> bool {
let (hi, lo) = util::split(value);
self.map.entry(hi).or_insert_with(RoaringBitmap::new).insert(lo)
self.map.entry(hi).or_default().insert(lo)
}

/// Inserts a range of values.
Expand Down Expand Up @@ -81,11 +81,11 @@ impl RoaringTreemap {

// Calculate the sub-range from the lower 32 bits
counter += if hi == end_hi && hi == start_hi {
entry.or_insert_with(RoaringBitmap::new).insert_range(start_lo..=end_lo)
entry.or_default().insert_range(start_lo..=end_lo)
} else if hi == start_hi {
entry.or_insert_with(RoaringBitmap::new).insert_range(start_lo..=u32::MAX)
entry.or_default().insert_range(start_lo..=u32::MAX)
} else if hi == end_hi {
entry.or_insert_with(RoaringBitmap::new).insert_range(0..=end_lo)
entry.or_default().insert_range(0..=end_lo)
} else {
// We insert a full bitmap if it doesn't already exist and return the size of it.
// But if the bitmap already exists at this spot we replace it with a full bitmap
Expand Down Expand Up @@ -122,7 +122,7 @@ impl RoaringTreemap {
/// ```
pub fn push(&mut self, value: u64) -> bool {
let (hi, lo) = util::split(value);
self.map.entry(hi).or_insert_with(RoaringBitmap::new).push(lo)
self.map.entry(hi).or_default().push(lo)
}

/// Pushes `value` in the treemap only if it is greater than the current maximum value.
Expand Down
Loading