• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use {
2     crate::{Arbitrary, Result, Unstructured},
3     core::sync::atomic::{AtomicBool, AtomicIsize, AtomicUsize},
4 };
5 
6 impl<'a> Arbitrary<'a> for AtomicBool {
arbitrary(u: &mut Unstructured<'a>) -> Result<Self>7     fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
8         Arbitrary::arbitrary(u).map(Self::new)
9     }
10 
11     #[inline]
size_hint(depth: usize) -> (usize, Option<usize>)12     fn size_hint(depth: usize) -> (usize, Option<usize>) {
13         <bool as Arbitrary<'a>>::size_hint(depth)
14     }
15 }
16 
17 impl<'a> Arbitrary<'a> for AtomicIsize {
arbitrary(u: &mut Unstructured<'a>) -> Result<Self>18     fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
19         Arbitrary::arbitrary(u).map(Self::new)
20     }
21 
22     #[inline]
size_hint(depth: usize) -> (usize, Option<usize>)23     fn size_hint(depth: usize) -> (usize, Option<usize>) {
24         <isize as Arbitrary<'a>>::size_hint(depth)
25     }
26 }
27 
28 impl<'a> Arbitrary<'a> for AtomicUsize {
arbitrary(u: &mut Unstructured<'a>) -> Result<Self>29     fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
30         Arbitrary::arbitrary(u).map(Self::new)
31     }
32 
33     #[inline]
size_hint(depth: usize) -> (usize, Option<usize>)34     fn size_hint(depth: usize) -> (usize, Option<usize>) {
35         <usize as Arbitrary<'a>>::size_hint(depth)
36     }
37 }
38