rust-iterator-emoji icon indicating copy to clipboard operation
rust-iterator-emoji copied to clipboard

Fix "unzip" example

Open mgeier opened this issue 4 years ago • 1 comments

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 avatar Mar 02 '21 09:03 mgeier

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

mgeier avatar Mar 05 '21 11:03 mgeier