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

Ten0 opened this issue Jan 10, 2020 · 1 comment


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:

	<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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants