You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It's common to have obejcts that use Uuid. And whenever someone wants to use rust-fuzz, all the components
of the object need to implement/derive the Arbitrary trait
Describe the solution you'd like
Having an implementation for Arbitrary for Uuid
Something like this would be a starting point:
implArbitrary<'_>forUuid{fnarbitrary(u:&mutUnstructured<'_>) -> ArbitraryResult<Self>{let b = u.bytes(16)?;Ok(Uuid::from_bytes(b.try_into().unwrap()))}}
However, I assume it will panic most of the time. So, I'm not sure what's the best way to go about it.
The text was updated successfully, but these errors were encountered:
I can imagine the most useful use of fuzzing with uuids would be to also mess with the versions so you don't just always receive an already random v4 uuid. If we just want to unblock #[derive(Arbitrary)] on types that contain Uuid fields though, then we could reasonably just use uuid::Builder to accept 16 random bytes and then set the version to v4 so it becomes infallible.
I'd be ok with adding an optional arbitrary feature to uuid, since the crate is 1.0 and am on-board with making life easier for everyone getting started with fuzzing.
@greyblake At this stage uuid is probably the better place for it. We're working on stabilizing the library now, but until then I wouldn't expect arbitrary to want to add a public implementation for an unstable library 🙂
Is your feature request related to a problem? Please describe.
It's common to have obejcts that use
Uuid
. And whenever someone wants to userust-fuzz
, all the componentsof the object need to implement/derive the Arbitrary trait
Describe the solution you'd like
Having an implementation for
Arbitrary
forUuid
Something like this would be a starting point:
However, I assume it will panic most of the time. So, I'm not sure what's the best way to go about it.
The text was updated successfully, but these errors were encountered: