Skip to content

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