pub const fn split(self) -> (NonZeroLength, NonZeroLength) {
        let mut mask = usize::MAX;
        loop {
            mask <<= 1;
            //debug_assert_ne!(mask, 0);

            let lhs = self.get() & mask;
            let rhs = self.get() & !mask;

            if lhs.count_ones().is_power_of_two() && rhs != 0 {
                let lhs = unsafe { NonZeroLength::new_unchecked(lhs) };
                let rhs = unsafe { NonZeroLength::new_unchecked(rhs) };
                break (lhs, rhs)
            }
        }
    }
/// Splits the `InnerLength` into left and right.
///
/// ```
/// # use proofmarshal_core::collections::length::{InnerLength, NonZeroLength};
/// # use proofmarshal_core::collections::height::Height;
/// assert_eq!(InnerLength::new(0b11).unwrap()
///                        .split(),
///            (NonZeroLength::new(0b10).unwrap(),
///             NonZeroLength::new(0b01).unwrap()));
///
/// assert_eq!(InnerLength::new(0b110).unwrap()
///                        .split(),
///            (NonZeroLength::new(0b100).unwrap(),
///             NonZeroLength::new(0b010).unwrap()));
///
/// assert_eq!(InnerLength::new(0b1111).unwrap()
///                        .split(),
///            (NonZeroLength::new(0b1100).unwrap(),
///             NonZeroLength::new(0b0011).unwrap()));
/// ```
Splits the `InnerLength` into left and right.
Splits the ` InnerLength ` into left and right .
pub const fn split(self) -> (NonZeroLength, NonZeroLength) {
        let mut mask = usize::MAX;
        loop {
            mask <<= 1;
            //debug_assert_ne!(mask, 0);
            let lhs = self.get() & mask;
            let rhs = self.get() & !mask;
            if lhs.count_ones().is_power_of_two() && rhs != 0 {
                let lhs = unsafe { NonZeroLength::new_unchecked(lhs) };
                let rhs = unsafe { NonZeroLength::new_unchecked(rhs) };
                break (lhs, rhs)
            }
        }
    }
pub const fn split ( self ) -> ( NonZeroLength , NonZeroLength ) { let mut mask = usize :: MAX ; loop { mask <<= 1 ; //debug_assert_ne!(mask, 0); let lhs = self . get ( ) & mask ; let rhs = self . get ( ) & ! mask ; if lhs . count_ones ( ) . is_power_of_two ( ) && rhs != 0 { let lhs = unsafe { NonZeroLength :: new_unchecked ( lhs ) } ; let rhs = unsafe { NonZeroLength :: new_unchecked ( rhs ) } ; break ( lhs , rhs ) } } }
Splits the `InnerLength` into left and right.
Splits the ` InnerLength ` into left and right .
self
use proofmarshal_core::collections::length::{innerlength, nonzerolength};
None
use proofmarshal_core::collections::height::height;
assert_eq!(InnerLength::new(0b11).unwrap()
.split(),
(NonZeroLength::new(0b10).unwrap(),
NonZeroLength::new(0b01).unwrap())).




assert_eq! ( InnerLength :: new ( 0b11 ) . unwrap () . split () ( NonZeroLength :: new ( 0b10 ) . unwrap () NonZeroLength :: new ( 0b01 ) . unwrap () )) .