pub fn split_last(&self) -> Option<(BitRef<Const, T, O>, &Self)> {
		match self.len() {
			0 => None,
			n => unsafe {
				let (rest, tail) = self.split_at_unchecked(n - 1);
				Some((tail.get_unchecked(0), rest))
			},
		}
	}
/// Splits the bit-slice into a reference to its last bit, and the rest of
/// the bit-slice. Returns `None` when empty.
///
/// ## Original
///
/// [`slice::split_last`](https://doc.rust-lang.org/std/primitive.slice.html#method.split_last)
///
/// ## API Differences
///
/// `bitvec` uses a custom structure for both read-only and mutable
/// references to `bool`.
///
/// ## Examples
///
/// ```rust
/// use bitvec::prelude::*;
///
/// let bits = bits![0, 0, 1];
/// let (last, rest) = bits.split_last().unwrap();
/// assert_eq!(last, &true);
/// assert_eq!(rest, bits![0; 2]);
/// ```
Splits the bit-slice into a reference to its last bit, and the rest of
the bit-slice. Returns `None` when empty.
Splits the bit - slice into a reference to its last bit and the rest of the bit - slice . Returns ` None ` when empty .
pub fn split_last(&self) -> Option<(BitRef<Const, T, O>, &Self)> {
		match self.len() {
			0 => None,
			n => unsafe {
				let (rest, tail) = self.split_at_unchecked(n - 1);
				Some((tail.get_unchecked(0), rest))
			},
		}
	}
pub fn split_last ( & self ) -> Option < ( BitRef < Const , T , O > , & Self ) > { match self . len ( ) { 0 => None , n => unsafe { let ( rest , tail ) = self . split_at_unchecked ( n - 1 ) ; Some ( ( tail . get_unchecked ( 0 ) , rest ) ) } , } }
Splits the bit-slice into a reference to its last bit, and the rest of
the bit-slice.
Splits the bit - slice into a reference to its last bit and the rest of the bit - slice .
&self
&self
original
None
api differences
`bitvec` uses a custom structure for both read-only and mutable
references to `bool`.
` bitvec ` uses a custom structure for both read - only and mutable references to ` bool ` .
examples
```rust
use bitvec::prelude::*.


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