pub fn force_align(&mut self) {
		let head = self.bitspan.head();
		if head == BitIdx::MIN {
			return;
		}
		let head = head.into_inner() as usize;
		let last = self.len() + head;
		unsafe {
			self.bitspan.set_head(BitIdx::MIN);
			self.copy_within_unchecked(head .. last, 0);
		}
	}
/// Ensures that the allocated buffer has no dead bits between the start of
/// the buffer and the start of the live bit-slice.
///
/// This is useful for ensuring a consistent memory layout in bit-boxes
/// created by cloning an arbitrary bit-slice into the heap. As bit-slices
/// can begin and end anywhere in memory, the [`::from_bitslice()`] function
/// does not attempt to normalize them and only does a fast element-wise
/// copy when creating the bit-box.
///
/// The value of dead bits that are in the allocation but not in the live
/// region are *initialized*, but do not have a *specified* value. After
/// calling this method, you should use [`.fill_uninitialized()`] to set the
/// excess bits in the buffer to a fixed value.
///
/// ## Examples
///
/// ```rust
/// use bitvec::prelude::*;
///
/// let bits = &0b10_1101_01u8.view_bits::<Msb0>()[2 .. 6];
/// let mut bb = BitBox::from_bitslice(bits);
/// // Remember, the two bits on each edge are unspecified, and cannot be
/// // observed! They must be masked away for the test to be meaningful.
/// assert_eq!(bb.as_raw_slice()[0] & 0x3C, 0b00_1101_00u8);
///
/// bb.force_align();
/// bb.fill_uninitialized(false);
/// assert_eq!(bb.as_raw_slice(), &[0b1101_0000u8]);
/// ```
///
/// [`::from_bitslice()`]: Self::from_bitslice
/// [`.fill_uninitialized()`]: Self::fill_uninitialized
Ensures that the allocated buffer has no dead bits between the start of
the buffer and the start of the live bit-slice.

This is useful for ensuring a consistent memory layout in bit-boxes
created by cloning an arbitrary bit-slice into the heap. As bit-slices
can begin and end anywhere in memory, the [`::from_bitslice()`] function
does not attempt to normalize them and only does a fast element-wise
copy when creating the bit-box.

The value of dead bits that are in the allocation but not in the live
region are *initialized*, but do not have a *specified* value. After
calling this method, you should use [`.fill_uninitialized()`] to set the
excess bits in the buffer to a fixed value.
Ensures that the allocated buffer has no dead bits between the start of the buffer and the start of the live bit - slice . This is useful for ensuring a consistent memory layout in bit - boxes created by cloning an arbitrary bit - slice into the heap . As bit - slices can begin and end anywhere in memory the [ ` :: from_bitslice () ` ] function does not attempt to normalize them and only does a fast element - wise copy when creating the bit - box . The value of dead bits that are in the allocation but not in the live region are * initialized * but do not have a * specified * value . After calling this method you should use [ ` . fill_uninitialized () ` ] to set the excess bits in the buffer to a fixed value .
pub fn force_align(&mut self) {
		let head = self.bitspan.head();
		if head == BitIdx::MIN {
			return;
		}
		let head = head.into_inner() as usize;
		let last = self.len() + head;
		unsafe {
			self.bitspan.set_head(BitIdx::MIN);
			self.copy_within_unchecked(head .. last, 0);
		}
	}
pub fn force_align ( & mut self ) { let head = self . bitspan . head ( ) ; if head == BitIdx :: MIN { return ; } let head = head . into_inner ( ) as usize ; let last = self . len ( ) + head ; unsafe { self . bitspan . set_head ( BitIdx :: MIN ) ; self . copy_within_unchecked ( head .. last , 0 ) ; } }
Ensures that the allocated buffer has no dead bits between the start of
the buffer and the start of the live bit-slice.
Ensures that the allocated buffer has no dead bits between the start of the buffer and the start of the live bit - slice .
&mut self
&mut self
examples
```rust
use bitvec::prelude::*.





[`::from_bitslice()`]: Self::from_bitslice
[`.fill_uninitialized()`]: Self::fill_uninitialized
` ` ` rust use bitvec :: prelude :: * . [ ` :: from_bitslice () ` ] : Self :: from_bitslice [ ` . fill_uninitialized () ` ] : Self :: fill_uninitialized