pub fn from_bools(leds: Vec<bool>) -> Self {
            if leds.len() > 8 {
                panic!("Number of bools must be smaller or equal to 8.");
            }

            let mut mask: u8 = 0;
            for (led, shift) in leds.iter().cloned().zip((0..=7).rev()) {
                mask |= (led as u8) << shift;
            }
            LedMask(mask)
        }
/// Construct the bit mask from a vector of bools.
///
/// # Arguments
///
/// * `leds` - true means that the LED should be turned on. 0th element
///   corresponds the LED 0 and so on. Missing elements are interpreted
///   as false.
///
/// # Panics
///
/// This method panics if the number of bools is larger than number of
/// bits in the mask.
Construct the bit mask from a vector of bools.
Construct the bit mask from a vector of bools .
pub fn from_bools(leds: Vec<bool>) -> Self {
            if leds.len() > 8 {
                panic!("Number of bools must be smaller or equal to 8.");
            }
            let mut mask: u8 = 0;
            for (led, shift) in leds.iter().cloned().zip((0..=7).rev()) {
                mask |= (led as u8) << shift;
            }
            LedMask(mask)
        }
pub fn from_bools ( leds : Vec < bool > ) -> Self { if leds . len ( ) > 8 { panic ! ( " " ) ; } let mut mask : u8 = 0 ; for ( led , shift ) in leds . iter ( ) . cloned ( ) . zip ( ( 0 ..= 7 ) . rev ( ) ) { mask |= ( led as u8 ) << shift ; } LedMask ( mask ) }
Construct the bit mask from a vector of bools.
Construct the bit mask from a vector of bools .
leds
Vec<bool>
leds
Vec<bool>
panics
This method panics if the number of bools is larger than number of
bits in the mask.
This method panics if the number of bools is larger than number of bits in the mask .