pub fn truncate(&mut self, len: usize) {
        if len > self.len {
            return;
        }
        self.len = len;
        self.vec.truncate(blocks_required::<T>(len));
        self.mask_last_block();
    }
/// Shortens the Vob, keeping the first `len` elements and dropping the rest.
///
/// If len is greater than the vector's current length, this has no effect.
///
/// The drain method can emulate truncate, but causes the excess elements to be returned
/// instead of dropped.
///
/// Note that this method has no effect on the allocated capacity of the vector.
///
/// # Examples
/// ```
/// use vob::vob;
/// let mut v = vob![true, false, true];
/// v.truncate(2);
/// assert_eq!(v, vob![true, false]);
/// ```
Shortens the Vob, keeping the first `len` elements and dropping the rest.
If len is greater than the vector's current length, this has no effect.

The drain method can emulate truncate, but causes the excess elements to be returned
instead of dropped.

Note that this method has no effect on the allocated capacity of the vector.
Shortens the Vob keeping the first ` len ` elements and dropping the rest . If len is greater than the vector ' s current length this has no effect . The drain method can emulate truncate but causes the excess elements to be returned instead of dropped . Note that this method has no effect on the allocated capacity of the vector .
pub fn truncate(&mut self, len: usize) {
        if len > self.len {
            return;
        }
        self.len = len;
        self.vec.truncate(blocks_required::<T>(len));
        self.mask_last_block();
    }
pub fn truncate ( & mut self , len : usize ) { if len > self . len { return ; } self . len = len ; self . vec . truncate ( blocks_required :: < T > ( len ) ) ; self . mask_last_block ( ) ; }
Shortens the Vob, keeping the first `len` elements and dropping the rest.
Shortens the Vob keeping the first ` len ` elements and dropping the rest .
&mut self
len
usize
&mut self
len
usize
examples
```
use vob::vob;
let mut v = vob![true, false, true];
v.truncate(2);
assert_eq!(v, vob![true, false]);
```
` ` ` use vob :: vob ; let mut v = vob! [ true false true ] ; v . truncate ( 2 ) ; assert_eq! ( v vob! [ true false ] ) ; ` ` `