pub fn remove_range(&mut self, range: Range<u64>) -> u64 {
        if range.start == range.end {
            return 0;
        }
        let mut keys_to_remove = Vec::new();
        let mut removed = 0;
        // inclusive bounds for start and end
        let (start_hi, start_lo) = util::split(range.start);
        let (end_hi, end_lo) = util::split(range.end - 1);
        for (&key, rb) in &mut self.map {
            if key >= start_hi && key <= end_hi {
                let a = if key == start_hi {
                    u64::from(start_lo)
                } else {
                    0
                };
                let b = if key == end_hi {
                    u64::from(end_lo) + 1 // make it exclusive
                } else {
                    u64::from(u32::max_value()) + 1
                };
                if a == 0 && b == u64::from(u32::max_value()) + 1 {
                    removed += rb.len();
                    keys_to_remove.push(key);
                } else {
                    removed += rb.remove_range(a..b);
                    if rb.is_empty() {
                        keys_to_remove.push(key);
                    }
                }
            }
        }

        for key in keys_to_remove {
            self.map.remove(&key);
        }

        removed
    }
/// Removes a range of values from the set specific as [start..end).
/// Returns the number of removed values.
///
/// Note that due to the exclusive end you can't remove the item at the
/// last index (u64::MAX) using this function!
///
/// # Examples
///
/// ```rust
/// use roaring::RoaringTreemap;
///
/// let mut rb = RoaringTreemap::new();
/// rb.insert(2);
/// rb.insert(3);
/// assert_eq!(rb.remove_range(2..4), 2);
/// ```
Removes a range of values from the set specific as [start..end).
Returns the number of removed values.

Note that due to the exclusive end you can't remove the item at the
last index (u64::MAX) using this function!
Removes a range of values from the set specific as [ start .. end ) . Returns the number of removed values . Note that due to the exclusive end you can ' t remove the item at the last index ( u64 :: MAX ) using this function!
pub fn remove_range(&mut self, range: Range<u64>) -> u64 {
        if range.start == range.end {
            return 0;
        }
        let mut keys_to_remove = Vec::new();
        let mut removed = 0;
        // inclusive bounds for start and end
        let (start_hi, start_lo) = util::split(range.start);
        let (end_hi, end_lo) = util::split(range.end - 1);
        for (&key, rb) in &mut self.map {
            if key >= start_hi && key <= end_hi {
                let a = if key == start_hi {
                    u64::from(start_lo)
                } else {
                    0
                };
                let b = if key == end_hi {
                    u64::from(end_lo) + 1 // make it exclusive
                } else {
                    u64::from(u32::max_value()) + 1
                };
                if a == 0 && b == u64::from(u32::max_value()) + 1 {
                    removed += rb.len();
                    keys_to_remove.push(key);
                } else {
                    removed += rb.remove_range(a..b);
                    if rb.is_empty() {
                        keys_to_remove.push(key);
                    }
                }
            }
        }
        for key in keys_to_remove {
            self.map.remove(&key);
        }
        removed
    }
pub fn remove_range ( & mut self , range : Range < u64 > ) -> u64 { if range . start == range . end { return 0 ; } let mut keys_to_remove = Vec :: new ( ) ; let mut removed = 0 ; // inclusive bounds for start and end let ( start_hi , start_lo ) = util :: split ( range . start ) ; let ( end_hi , end_lo ) = util :: split ( range . end - 1 ) ; for ( & key , rb ) in & mut self . map { if key >= start_hi && key <= end_hi { let a = if key == start_hi { u64 :: from ( start_lo ) } else { 0 } ; let b = if key == end_hi { u64 :: from ( end_lo ) + 1 // make it exclusive } else { u64 :: from ( u32 :: max_value ( ) ) + 1 } ; if a == 0 && b == u64 :: from ( u32 :: max_value ( ) ) + 1 { removed += rb . len ( ) ; keys_to_remove . push ( key ) ; } else { removed += rb . remove_range ( a .. b ) ; if rb . is_empty ( ) { keys_to_remove . push ( key ) ; } } } } for key in keys_to_remove { self . map . remove ( & key ) ; } removed }
Removes a range of values from the set specific as [start..end).
Removes a range of values from the set specific as [ start .. end ) .
&mut self
range
Range<u64>
&mut self
range
Range<u64>
examples
```rust
use roaring::RoaringTreemap.


` ` ` rust use roaring :: RoaringTreemap .