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

IntoEnumIterator should have a constraint on Iterator: Iterator<Item=Self> #80

Closed
Ten0 opened this issue Jan 10, 2020 · 1 comment
Closed

Comments

@Ten0
Copy link

@Ten0 Ten0 commented Jan 10, 2020

IntoEnumIterator does not have a constraint on Iterator: Iterator<Item=Self>.
When writing generic code on any IntoEnumIterator, it forces us to write the very verbose:

where
	<Self as IntoEnumIterator>::Iterator: Iterator<Item = Self>,

though that behaviour could be enforced as it is documented on the trait.

We could avoid having to write this by adding an Iterator<Item=Self> bound on the associated type Iterator of IntoEnumIterator.

Peternator7 pushed a commit that referenced this issue Mar 1, 2020
@Peternator7
Copy link
Owner

@Peternator7 Peternator7 commented Mar 2, 2020

Simple and shouldn't break anyone unless they were manually implementing the trait on something other than an enum.

This was easy so I went ahead and added it to version 0.18.0. [https://crates.io/crates/strum]

@Peternator7 Peternator7 closed this Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants