-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Arbitrary for AsMut<[T: Arbitrary]> #291
Comments
Having |
Sorry, I was trying to generalise the original issue I had (being unable to use I also forgot that arbitrary doesn't take impl Gen {
/// Fill a mutable slice of any Arbitrary-compatible type with Arbitrary
/// values.
pub fn fill_slice<S, T>(&mut self, mut slice: S)
where
T: Arbitrary,
S: AsMut<[T]>,
{
slice.as_mut().fill_with(|| T::arbitrary(self))
}
} I might just send a PR with this because the above works for me. |
Because of #265, it's no longer possible to do something like
But it seems as though it would be reasonable to simply have an
Arbitrary
implementation for&mut [T: Arbitrary]
that doesfill_bytes
internally.The text was updated successfully, but these errors were encountered: