-
Notifications
You must be signed in to change notification settings - Fork 161
Closed
Description
Would it be worth it to have an optional implementation of Arbitrary (in the arbitrary crate) for bitflags types, to make it easier to use them in fuzzing?
I'm imagining something along the lines of this, added to the macro expansion when cfg(feature = "arbitrary") or so:
impl arbitrary::Arbitrary for $BitFlags {
fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<Self> {
Self::from_bits(u.arbitrary()).ok_or_else(|| arbitrary::Error::IncorrectFormat)
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels