Skip to content

Add flatten() free function and fix flatten tests #266

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Mar 4, 2018
Merged

Conversation

bluss
Copy link
Member

@bluss bluss commented Mar 4, 2018

This restores our travis to working order by not using .flatten() directly, since it is now incompatible with Rust nightly.

We introduce a free function flatten — similar to many other IntoIterator-enabled free functions we already have: https://docs.rs/itertools/0.7.6/itertools/#functions

The benefit of flatten as a free function is that we can support it from Rust 1.12.0 (version req right now) and for all the forseeable future. In a future version of itertools, this free function will be "upgraded" to use the std .flatten() iterator. The free function will remain while we will remove Itertools::flatten (unless std removes their version) in a future version.

Users that have compatibility problems with Itertools::flatten and its clash with Iterator::flatten, they can either use use itertools::Itertools; Itertools::flatten( expression ) or use itertools::flatten; flatten( expression ).

@bluss bluss merged commit b4cde06 into master Mar 4, 2018
@bluss bluss deleted the flatten-workarounds branch March 4, 2018 15:50
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant