arbitrary/foreign/std/ffi/
os_str.rs

1use {
2    crate::{Arbitrary, Result, Unstructured},
3    std::ffi::OsString,
4};
5
6impl<'a> Arbitrary<'a> for OsString {
7    fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
8        <String as Arbitrary>::arbitrary(u).map(From::from)
9    }
10
11    #[inline]
12    fn size_hint(depth: usize) -> (usize, Option<usize>) {
13        <String as Arbitrary>::size_hint(depth)
14    }
15}
16
17// impl Arbitrary for Box<OsStr> {
18//     fn arbitrary(u: &mut Unstructured<'_>) -> Result<Self> {
19//         <OsString as Arbitrary>::arbitrary(u).map(|x| x.into_boxed_osstr())
20//
21//     }
22// }