-
Notifications
You must be signed in to change notification settings - Fork 308
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
fix: take_while_inclusive takes iterator by value #709
fix: take_while_inclusive takes iterator by value #709
Conversation
this helps in case TakeWhileInclusive is returned from a function, as otherwise we would be returning a struct which takes a reference from a locally created iterator.
I thought you had a point so I looked at the methods in There are 4 cases:
tldr I fully agree with you. PS: It's a breaking change but |
I think @Philippe-Cholet's assessment is correct. Thus, I'd like to merge this. @jswrenn Do you have objections? |
Hi @phimuemue @jswrenn , Thanks! |
Thanks a lot. bors r+ |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Thank you for this! Apologizes for not releasing this fast enough to avoid a breaking release; I was on an extended bicycle tour. I'll get out a release soon. |
@jswrenn I just hit this issue and found this PR. Just wanna make sure that you haven't forgot about the release. Thanks for your work, |
Summary: [Release Notes for 0.12.0](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md#0120) [Release Notes for 0.12.1](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md#0121) ### Breaking - Made `take_while_inclusive` consume iterator by value ([#709](rust-itertools/itertools#709)) --- there are [2 usages](https://www.internalfb.com/code/search?q=repo%3Afbcode%20take_while_inclusive&lang_filter=rust) in fbcode, verified both manually - Added `Clone` bound to `Unique` ([#777](rust-itertools/itertools#777)) --- there are [37 usages](https://fburl.com/code/hp7vdlch) in fbcode, CI will tell if it breaks Reviewed By: anps77 Differential Revision: D64305791 fbshipit-source-id: fe99131b206905133c4d2b75693090f5ce44f4ca
Summary: [Release Notes for 0.12.0](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md#0120) [Release Notes for 0.12.1](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md#0121) ### Breaking - Made `take_while_inclusive` consume iterator by value ([#709](rust-itertools/itertools#709)) --- there are [2 usages](https://www.internalfb.com/code/search?q=repo%3Afbcode%20take_while_inclusive&lang_filter=rust) in fbcode, verified both manually - Added `Clone` bound to `Unique` ([#777](rust-itertools/itertools#777)) --- there are [37 usages](https://fburl.com/code/hp7vdlch) in fbcode, CI will tell if it breaks Reviewed By: anps77 Differential Revision: D64305791 fbshipit-source-id: fe99131b206905133c4d2b75693090f5ce44f4ca
Summary: [Release Notes for 0.12.0](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md#0120) [Release Notes for 0.12.1](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md#0121) ### Breaking - Made `take_while_inclusive` consume iterator by value ([#709](rust-itertools/itertools#709)) --- there are [2 usages](https://www.internalfb.com/code/search?q=repo%3Afbcode%20take_while_inclusive&lang_filter=rust) in fbcode, verified both manually - Added `Clone` bound to `Unique` ([#777](rust-itertools/itertools#777)) --- there are [37 usages](https://fburl.com/code/hp7vdlch) in fbcode, CI will tell if it breaks Reviewed By: anps77 Differential Revision: D64305791 fbshipit-source-id: fe99131b206905133c4d2b75693090f5ce44f4ca
Summary: [Release Notes for 0.12.0](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md#0120) [Release Notes for 0.12.1](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md#0121) ### Breaking - Made `take_while_inclusive` consume iterator by value ([#709](rust-itertools/itertools#709)) --- there are [2 usages](https://www.internalfb.com/code/search?q=repo%3Afbcode%20take_while_inclusive&lang_filter=rust) in fbcode, verified both manually - Added `Clone` bound to `Unique` ([#777](rust-itertools/itertools#777)) --- there are [37 usages](https://fburl.com/code/hp7vdlch) in fbcode, CI will tell if it breaks Reviewed By: anps77 Differential Revision: D64305791 fbshipit-source-id: fe99131b206905133c4d2b75693090f5ce44f4ca
Summary: [Release Notes for 0.12.0](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md#0120) [Release Notes for 0.12.1](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md#0121) ### Breaking - Made `take_while_inclusive` consume iterator by value ([#709](rust-itertools/itertools#709)) --- there are [2 usages](https://www.internalfb.com/code/search?q=repo%3Afbcode%20take_while_inclusive&lang_filter=rust) in fbcode, verified both manually - Added `Clone` bound to `Unique` ([#777](rust-itertools/itertools#777)) --- there are [37 usages](https://fburl.com/code/hp7vdlch) in fbcode, CI will tell if it breaks Reviewed By: anps77 Differential Revision: D64305791 fbshipit-source-id: fe99131b206905133c4d2b75693090f5ce44f4ca
Summary: [Release Notes for 0.12.0](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md#0120) [Release Notes for 0.12.1](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md#0121) ### Breaking - Made `take_while_inclusive` consume iterator by value ([#709](rust-itertools/itertools#709)) --- there are [2 usages](https://www.internalfb.com/code/search?q=repo%3Afbcode%20take_while_inclusive&lang_filter=rust) in fbcode, verified both manually - Added `Clone` bound to `Unique` ([#777](rust-itertools/itertools#777)) --- there are [37 usages](https://fburl.com/code/hp7vdlch) in fbcode, CI will tell if it breaks Reviewed By: anps77 Differential Revision: D64305791 fbshipit-source-id: fe99131b206905133c4d2b75693090f5ce44f4ca
this helps in case
TakeWhileInclusive
is returned from a function, as otherwise we would be returning a struct which takes a reference from a locally created iterator.example code which breaks, but shouldn't:
Rust Playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f602ba3c6e7c2ab2f5132a0b40b80ceb