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

Deprecate flatten #262

Closed
clarfonthey opened this issue Feb 27, 2018 · 4 comments
Closed

Deprecate flatten #262

clarfonthey opened this issue Feb 27, 2018 · 4 comments

Comments

@clarfonthey
Copy link

This is slated to be added to libstd via rust-lang/rust#48213 and it may be useful to just deprecate this method on itertools now to help push people into adopting it. In the meantime, I think that suggesting .flat_map(|x| x) is a reasonable alternative, even if it's not the most performant.

@bluss
Copy link
Member

bluss commented Feb 27, 2018

Ok it's on the list in #223. This time it's for real, we have a real collision and it needs a solution. “Fortunately” it only breaks .flatten() users and not all itertools users. Deprecate sounds good, but to resolve the conflict smoothly, perhaps even a version check and conditional compilation is something we need to use.

@clarfonthey
Copy link
Author

Perhaps having the ability to do #[cfg(feature = "iter_flatten")] for the compiler feature might be useful.

@samueltardieu
Copy link
Contributor

@bluss It breaks .flatten() users but also transitively users of libraries using .flatten(). I noticed it indirectly for my pathfinding crate through the recompilation of a program that uses this crate.

@qmx
Copy link

qmx commented Sep 27, 2018

.flatten() just hit rustc-stable (1.29), it'd be nice to fix the conflict sooner than later :)

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

4 participants