pub fn swap(&mut self, a: usize, b: usize) {
		let bounds = 0 .. self.len();
		self.assert_in_bounds(a, bounds.clone());
		self.assert_in_bounds(b, bounds);
		unsafe {
			self.swap_unchecked(a, b);
		}
	}
/// Exchanges the bit values at two indices.
///
/// ## Original
///
/// [`slice::swap`](https://doc.rust-lang.org/std/primitive.slice.html#method.swap)
///
/// ## Panics
///
/// This panics if either `a` or `b` are out of bounds.
///
/// ## Examples
///
/// ```rust
/// use bitvec::prelude::*;
///
/// let bits = bits![mut 0, 1];
/// bits.swap(0, 1);
/// assert_eq!(bits, bits![1, 0]);
/// ```
Exchanges the bit values at two indices.
Exchanges the bit values at two indices .
pub fn swap(&mut self, a: usize, b: usize) {
		let bounds = 0 .. self.len();
		self.assert_in_bounds(a, bounds.clone());
		self.assert_in_bounds(b, bounds);
		unsafe {
			self.swap_unchecked(a, b);
		}
	}
pub fn swap ( & mut self , a : usize , b : usize ) { let bounds = 0 .. self . len ( ) ; self . assert_in_bounds ( a , bounds . clone ( ) ) ; self . assert_in_bounds ( b , bounds ) ; unsafe { self . swap_unchecked ( a , b ) ; } }
Exchanges the bit values at two indices.
Exchanges the bit values at two indices .
&mut self
a
usize
b
usize
&mut self
a
usize
b
usize
original
None
panics
This panics if either `a` or `b` are out of bounds.
This panics if either ` a ` or ` b ` are out of bounds .
examples
```rust
use bitvec::prelude::*.


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