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