pub fn last(&self) -> Option<BitRef<Const, T, O>> {
		match self.len() {
			0 => None,
			n => Some(unsafe { self.get_unchecked(n - 1) }),
		}
	}
/// Gets a reference to the last bit of the bit-slice, or `None` if it is
/// empty.
///
/// ## Original
///
/// [`slice::last`](https://doc.rust-lang.org/std/primitive.slice.html#method.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];
/// assert_eq!(bits.last().as_deref(), Some(&true));
///
/// assert!(bits![].last().is_none());
/// ```
Gets a reference to the last bit of the bit-slice, or `None` if it is
empty.
Gets a reference to the last bit of the bit - slice or ` None ` if it is empty .
pub fn last(&self) -> Option<BitRef<Const, T, O>> {
		match self.len() {
			0 => None,
			n => Some(unsafe { self.get_unchecked(n - 1) }),
		}
	}
pub fn last ( & self ) -> Option < BitRef < Const , T , O > > { match self . len ( ) { 0 => None , n => Some ( unsafe { self . get_unchecked ( n - 1 ) } ) , } }
Gets a reference to the last bit of the bit-slice, or `None` if it is
empty.
Gets a reference to the last bit of the bit - slice or ` None ` if it is empty .
&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 :: * .