1 use { 2 crate::{Arbitrary, MaxRecursionReached, Result, Unstructured}, 3 std::sync::Mutex, 4 }; 5 6 impl<'a, A> Arbitrary<'a> for Mutex<A> 7 where 8 A: Arbitrary<'a>, 9 { arbitrary(u: &mut Unstructured<'a>) -> Result<Self>10 fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> { 11 Arbitrary::arbitrary(u).map(Self::new) 12 } 13 14 #[inline] size_hint(depth: usize) -> (usize, Option<usize>)15 fn size_hint(depth: usize) -> (usize, Option<usize>) { 16 Self::try_size_hint(depth).unwrap_or_default() 17 } 18 19 #[inline] try_size_hint(depth: usize) -> Result<(usize, Option<usize>), MaxRecursionReached>20 fn try_size_hint(depth: usize) -> Result<(usize, Option<usize>), MaxRecursionReached> { 21 A::try_size_hint(depth) 22 } 23 } 24