pub fn push(&mut self, value: bool) {
		let len = self.len();
		let new_len = len + 1;
		Self::assert_len_encodable(new_len);
		//  Push a new `T` into the underlying buffer if needed.
		if len == 0 || self.bitspan.tail() == BitEnd::MAX {
			self.with_vec(|vec| vec.push(T::ZERO));
		}
		//  Write `value` into the now-safely-allocated `len` slot.
		unsafe {
			self.set_len_unchecked(new_len);
			self.set_unchecked(len, value);
		}
	}
/// Appends a single bit to the vector.
///
/// ## Original
///
/// [`Vec::push`](alloc::vec::Vec::push)
///
/// ## Panics
///
/// This panics if the push would cause the bit-vector to exceed its maximum
/// capacity.
///
/// ## Examples
///
/// ```rust
/// use bitvec::prelude::*;
///
/// let mut bv = bitvec![0, 0];
/// bv.push(true);
/// assert_eq!(bv.as_bitslice(), bits![0, 0, 1]);
/// ```
Appends a single bit to the vector.
Appends a single bit to the vector .
pub fn push(&mut self, value: bool) {
		let len = self.len();
		let new_len = len + 1;
		Self::assert_len_encodable(new_len);
		//  Push a new `T` into the underlying buffer if needed.
		if len == 0 || self.bitspan.tail() == BitEnd::MAX {
			self.with_vec(|vec| vec.push(T::ZERO));
		}
		//  Write `value` into the now-safely-allocated `len` slot.
		unsafe {
			self.set_len_unchecked(new_len);
			self.set_unchecked(len, value);
		}
	}
pub fn push ( & mut self , value : bool ) { let len = self . len ( ) ; let new_len = len + 1 ; Self :: assert_len_encodable ( new_len ) ; //  Push a new `T` into the underlying buffer if needed. if len == 0 || self . bitspan . tail ( ) == BitEnd :: MAX { self . with_vec ( | vec | vec . push ( T :: ZERO ) ) ; } //  Write `value` into the now-safely-allocated `len` slot. unsafe { self . set_len_unchecked ( new_len ) ; self . set_unchecked ( len , value ) ; } }
Appends a single bit to the vector.
Appends a single bit to the vector .
&mut self
value
bool
&mut self
value
bool
original
None
panics
This panics if the push would cause the bit-vector to exceed its maximum
capacity.
This panics if the push would cause the bit - vector to exceed its maximum capacity .
examples
```rust
use bitvec::prelude::*.


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