pub fn repeat(bit: bool, len: usize) -> Self {
		let mut out = Self::with_capacity(len);
		unsafe {
			out.set_len(len);
			out.as_raw_mut_slice().fill_with(|| {
				BitStore::new(if bit { !<T::Mem>::ZERO } else { <T::Mem>::ZERO })
			});
		}
		out
	}
/// Creates a new bit-vector by repeating a bit for the desired length.
///
/// ## Examples
///
/// ```rust
/// use bitvec::prelude::*;
///
/// let zeros = BitVec::<u8, Msb0>::repeat(false, 50);
/// let ones = BitVec::<u16, Lsb0>::repeat(true, 50);
/// ```
Creates a new bit-vector by repeating a bit for the desired length.
Creates a new bit - vector by repeating a bit for the desired length .
pub fn repeat(bit: bool, len: usize) -> Self {
		let mut out = Self::with_capacity(len);
		unsafe {
			out.set_len(len);
			out.as_raw_mut_slice().fill_with(|| {
				BitStore::new(if bit { !<T::Mem>::ZERO } else { <T::Mem>::ZERO })
			});
		}
		out
	}
pub fn repeat ( bit : bool , len : usize ) -> Self { let mut out = Self :: with_capacity ( len ) ; unsafe { out . set_len ( len ) ; out . as_raw_mut_slice ( ) . fill_with ( | | { BitStore :: new ( if bit { ! < T :: Mem > :: ZERO } else { < T :: Mem > :: ZERO } ) } ) ; } out }
Creates a new bit-vector by repeating a bit for the desired length.
Creates a new bit - vector by repeating a bit for the desired length .
bit
bool
len
usize
bit
bool
len
usize
examples
```rust
use bitvec::prelude::*.

let zeros = BitVec::::repeat(false, 50);
let ones = BitVec::::repeat(true, 50);
```
` ` ` rust use bitvec :: prelude :: * . let zeros = BitVec :::: repeat ( false 50 ) ; let ones = BitVec :::: repeat ( true 50 ) ; ` ` `