Skip to content

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

Closed
nicoonoclaste wants to merge 1 commit into
BurntSushi:masterfrom
nicoonoclaste:arbitrary-arrays
Closed

Implement Arbitrary for fixed-sized arrays of Arbitrary elements#289
nicoonoclaste wants to merge 1 commit into
BurntSushi:masterfrom
nicoonoclaste:arbitrary-arrays

Conversation

@nicoonoclaste
Copy link
Copy Markdown

  • 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
Copy Markdown
Owner

This looks like a duplicate of #282.

@nicoonoclaste
Copy link
Copy Markdown
Author

@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.

@nicoonoclaste
Copy link
Copy Markdown
Author

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

@nicoonoclaste nicoonoclaste 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