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

Fix "unzip" example #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix "unzip" example #1

wants to merge 1 commit into from

Conversation

mgeier
Copy link

@mgeier mgeier commented Mar 2, 2021

playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=eabdf778bf3063e24bb66104786a84d2

I don't know if there is a way to avoid .cloned(), but without it, it doesn't seem to compile.

@mgeier
Copy link
Author

mgeier commented Mar 5, 2021

For the record, a way to avoid .cloned() is to use std::array::IntoIter::new(), which is available in the beta version of Rust, see https://blog.rust-lang.org/2021/02/26/const-generics-mvp-beta.html#by-value-array-iterator.

playground: https://play.rust-lang.org/?version=beta&mode=debug&edition=2018&gist=da37c295f3b86bffe27b0b7f3afad156

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

Successfully merging this pull request may close these issues.

1 participant