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

impl PeekingNext for &mut PeekingNext #678

Closed
ijackson opened this issue Feb 10, 2023 · 3 comments
Closed

impl PeekingNext for &mut PeekingNext #678

ijackson opened this issue Feb 10, 2023 · 3 comments

Comments

@ijackson
Copy link

ijackson commented Feb 10, 2023

Is there some reason we don't have this?

impl<I: PeekingNext> PeekingNext for &mut I { ... }

I can't thinkl of one and I found myself wanting it. Should I prepare an MR?

@scottmcm
Copy link
Contributor

Beware that &mut is fundamental, so this is a breaking change and will need a semver major version bump. (I could have implemented PeekingNext for &mut MyIterator, which this would break.)

I doubt anyone did, but should probably take the bump just in case.

(This problem is why, sadly, we couldn't add impl<E: Extend> Extend for &mut E in core.)

@Philippe-Cholet
Copy link
Member

It seems to me that #643 implements exactly this, and it was released in 0.11.0.
I really don't see why it added Self: Sized constraint thought.

@ijackson
Copy link
Author

It seems to me that #643 implements exactly this, and it was released in 0.11.0.

So it did, thanks.

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

3 participants