arbitrary/foreign/alloc/
string.rs1use {
2 crate::{Arbitrary, Result, Unstructured},
3 std::string::String,
4};
5
6impl<'a> Arbitrary<'a> for String {
7 fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
8 <&str as Arbitrary>::arbitrary(u).map(Into::into)
9 }
10
11 fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self> {
12 <&str as Arbitrary>::arbitrary_take_rest(u).map(Into::into)
13 }
14
15 #[inline]
16 fn size_hint(depth: usize) -> (usize, Option<usize>) {
17 <&str as Arbitrary>::size_hint(depth)
18 }
19}