Skip to content
Merged
Show file tree
Hide file tree
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
23 changes: 0 additions & 23 deletions roaring/src/bitmap/inherent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,29 +298,6 @@ impl RoaringBitmap {
inserted
}

/// Pushes `value` in the bitmap only if it is greater than the current maximum value.
///
/// Returns whether the value was inserted.
///
/// # Examples
///
/// ```rust
/// use roaring::RoaringBitmap;
///
/// let mut rb = RoaringBitmap::new();
/// assert!(rb.push(1));
/// assert!(rb.push(3));
/// assert_eq!(rb.push(3), false);
/// assert!(rb.push(5));
///
/// assert_eq!(rb.iter().collect::<Vec<u32>>(), vec![1, 3, 5]);
/// ```
#[inline]
#[deprecated(since = "0.11.0", note = "use `try_push` instead")]
pub fn push(&mut self, value: u32) -> bool {
self.try_push(value).is_ok()
}

/// Pushes `value` in the bitmap only if it is greater than the current maximum value.
///
/// Returns an error if the value is not greater than the current maximum value.
Expand Down
23 changes: 0 additions & 23 deletions roaring/src/treemap/inherent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,29 +107,6 @@ impl RoaringTreemap {
counter
}

/// Pushes `value` in the treemap only if it is greater than the current maximum value.
///
/// Returns whether the value was inserted.
///
/// # Examples
///
/// ```rust
/// use roaring::RoaringTreemap;
///
/// let mut rb = RoaringTreemap::new();
/// assert!(rb.push(1));
/// assert!(rb.push(3));
/// assert_eq!(rb.push(3), false);
/// assert!(rb.push(5));
///
/// assert_eq!(rb.iter().collect::<Vec<u64>>(), vec![1, 3, 5]);
/// ```
#[deprecated(since = "0.11.0", note = "use `try_push` instead")]
pub fn push(&mut self, value: u64) -> bool {
let (hi, lo) = util::split(value);
self.map.entry(hi).or_default().try_push(lo).is_ok()
}

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