pub fn split_last_mut(
		&mut self,
	) -> Option<(BitRef<Mut, T::Alias, O>, &mut BitSlice<T::Alias, O>)> {
		match self.len() {
			0 => None,
			n => unsafe {
				let (rest, tail) = self.split_at_unchecked_mut(n - 1);
				Some((tail.get_unchecked_mut(0), rest))
			},
		}
	}
/// Splits the bit-slice into mutable references to its last bit, and the
/// rest of the bit-slice. Returns `None` when empty.
///
/// ## Original
///
/// [`slice::split_last_mut`](https://doc.rust-lang.org/std/primitive.slice.html#method.split_last_mut)
///
/// ## API Differences
///
/// `bitvec` uses a custom structure for both read-only and mutable
/// references to `bool`. This must be bound as `mut` in order to write
/// through it.
///
/// ## Examples
///
/// ```rust
/// use bitvec::prelude::*;
///
/// let bits = bits![mut 0; 3];
/// if let Some((mut last, rest)) = bits.split_last_mut() {
///   *last = true;
///   assert_eq!(rest, bits![0; 2]);
/// }
/// assert_eq!(bits, bits![0, 0, 1]);
/// ```
Splits the bit-slice into mutable references to its last bit, and the
rest of the bit-slice. Returns `None` when empty.
Splits the bit - slice into mutable references to its last bit and the rest of the bit - slice . Returns ` None ` when empty .
pub fn split_last_mut(
		&mut self,
	) -> Option<(BitRef<Mut, T::Alias, O>, &mut BitSlice<T::Alias, O>)> {
		match self.len() {
			0 => None,
			n => unsafe {
				let (rest, tail) = self.split_at_unchecked_mut(n - 1);
				Some((tail.get_unchecked_mut(0), rest))
			},
		}
	}
pub fn split_last_mut ( & mut self , ) -> Option < ( BitRef < Mut , T :: Alias , O > , & mut BitSlice < T :: Alias , O > ) > { match self . len ( ) { 0 => None , n => unsafe { let ( rest , tail ) = self . split_at_unchecked_mut ( n - 1 ) ; Some ( ( tail . get_unchecked_mut ( 0 ) , rest ) ) } , } }
Splits the bit-slice into mutable references to its last bit, and the
rest of the bit-slice.
Splits the bit - slice into mutable references to its last bit and the rest of the bit - slice .
&mut self
&mut self
original
None
api differences
`bitvec` uses a custom structure for both read-only and mutable
references to `bool`. This must be bound as `mut` in order to write
through it.
` bitvec ` uses a custom structure for both read - only and mutable references to ` bool ` . This must be bound as ` mut ` in order to write through it .
examples
```rust
use bitvec::prelude::*.


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