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
Contributor

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

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]

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

No branches or pull requests

2 participants