pub fn swap_remove(&mut self, index: usize) -> bool {
		self.assert_in_bounds(index, 0 .. self.len());
		let last = self.len() - 1;
		unsafe {
			self.swap_unchecked(index, last);
			self.set_len(last);
			*self.get_unchecked(last)
		}
	}
/// Takes a bit out of the bit-vector.
///
/// The empty slot is filled with the last bit in the bit-vector, rather
/// than shunting `index + 1 .. self.len()` down by one.
///
/// ## Original
///
/// [`Vec::swap_remove`](alloc::vec::Vec::swap_remove)
///
/// ## Panics
///
/// This panics if `index` is out of bounds (`self.len()` or greater).
///
/// ## Examples
///
/// ```rust
/// use bitvec::prelude::*;
///
/// let mut bv = bitvec![0, 1, 0, 0, 1];
/// assert!(!bv.swap_remove(2));
/// assert_eq!(bv, bits![0, 1, 1, 0]);
/// ```
Takes a bit out of the bit-vector.
The empty slot is filled with the last bit in the bit-vector, rather
than shunting `index + 1 ..
Takes a bit out of the bit - vector . The empty slot is filled with the last bit in the bit - vector rather than shunting ` index + 1 ..
pub fn swap_remove(&mut self, index: usize) -> bool {
		self.assert_in_bounds(index, 0 .. self.len());
		let last = self.len() - 1;
		unsafe {
			self.swap_unchecked(index, last);
			self.set_len(last);
			*self.get_unchecked(last)
		}
	}
pub fn swap_remove ( & mut self , index : usize ) -> bool { self . assert_in_bounds ( index , 0 .. self . len ( ) ) ; let last = self . len ( ) - 1 ; unsafe { self . swap_unchecked ( index , last ) ; self . set_len ( last ) ; * self . get_unchecked ( last ) } }
Takes a bit out of the bit-vector.
Takes a bit out of the bit - vector .
&mut self
index
usize
&mut self
index
usize
original
None
panics
This panics if `index` is out of bounds (`self.len()` or greater).
This panics if ` index ` is out of bounds ( ` self . len () ` or greater ) .
examples
```rust
use bitvec::prelude::*.


` ` ` rust use bitvec :: prelude :: * .