1 use crate::{Arbitrary, Result, Unstructured}; 2 3 impl<'a> Arbitrary<'a> for bool { arbitrary(u: &mut Unstructured<'a>) -> Result<Self>4 fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> { 5 Ok(<u8 as Arbitrary<'a>>::arbitrary(u)? & 1 == 1) 6 } 7 8 #[inline] size_hint(depth: usize) -> (usize, Option<usize>)9 fn size_hint(depth: usize) -> (usize, Option<usize>) { 10 <u8 as Arbitrary<'a>>::size_hint(depth) 11 } 12 } 13