Skip to content

Commit 225db06

Browse files
authored
Merge pull request #261 from RoaringBitmap/make-nightly-clippy-happy
Make nightly clippy happy
2 parents 4f8c798 + ab12519 commit 225db06

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/treemap/inherent.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl RoaringTreemap {
4646
/// ```
4747
pub fn insert(&mut self, value: u64) -> bool {
4848
let (hi, lo) = util::split(value);
49-
self.map.entry(hi).or_insert_with(RoaringBitmap::new).insert(lo)
49+
self.map.entry(hi).or_default().insert(lo)
5050
}
5151

5252
/// Inserts a range of values.
@@ -81,11 +81,11 @@ impl RoaringTreemap {
8181

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

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

0 commit comments

Comments
 (0)