Skip to content

Commit

Permalink
implement Arbitrary::size_hint
Browse files Browse the repository at this point in the history
This makes generating from non-arbitrary crates work much better, as
they know how many bytes are needed to arbitrary-generate an uuid.
  • Loading branch information
Ekleog committed Jan 28, 2023
1 parent 60ca9af commit 212b902
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/external/arbitrary_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ impl Arbitrary<'_> for Uuid {

Ok(Builder::from_random_bytes(b).into_uuid())
}

fn size_hint(depth: usize) -> (usize, Option<usize>) {
(16, Some(16))
}
}

#[cfg(test)]
Expand Down

0 comments on commit 212b902

Please sign in to comment.