Skip to content
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 fixed-sized arrays of Arbitrary elements #289

Closed
wants to merge 1 commit into from
Closed

Implement Arbitrary for fixed-sized arrays of Arbitrary elements #289

wants to merge 1 commit into from

Conversation

nbraud
Copy link

@nbraud nbraud commented May 17, 2021

  • Implement Arbitrary::gen
  • Implement Arbitrary::shrink

I tried implementing a non-trivial shrinker, but this ended up requiring T: Clone
and a lot of lifetime issues, so it seemed better to keep the dummy shrinker.

This PR depends on const generics, so that would bump the MSRV to 1.51 and
require a minor release. Alternatively, this functionality could be hidden
behind an opt-in feature flag.

@BurntSushi
Copy link
Owner

This looks like a duplicate of #282.

@nbraud
Copy link
Author

nbraud commented May 17, 2021

@BurntSushi Oops, yes, I missed that there was an open PR for it (apparently I only checked whether an issue existed...)
Sorry about that, feel free to close if the version in #282 is preferred.

@nbraud
Copy link
Author

nbraud commented May 17, 2021

I just saw the comment saying you'd rather not use array-init, closing.
Again, sorry for missing the existing PR >_>'

@nbraud nbraud closed this May 17, 2021
@nbraud nbraud deleted the arbitrary-arrays branch May 17, 2021 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants