3 ms·
It sounds like your rust is too old. IIRC the array FromIterator is only a month or two old.
by kevincox 5y ago
It sounds like your rust is too old. IIRC the array FromIterator is only a month or two old.
- tialaramex 5y agoRust 1.53 is from June 2021 and that's where this first works (until Rust Edition 2021 you can't actually just method call into_iter() on arrays because that would mask syntax that could work in some cases on older Rust code, but this code uses the for loop which does not actually do a method call to get the iterator)
- jll29 5y agoThanks, Kevin, that was it. I didn't expect Rust to (still) move that fast. ;)
- tialaramex 5y agoThis (arrays implementing IntoIterator) is probably the improvement with broadest impact of the last 12 months. It even makes lots of Rust's documentation examples more readable. Previously if there's an iterator involved somewhere, the doc example ends up constructing say vec![1,2,3,4,5] and a reasonable novice might ask why do we use a vector here? Today Rust's documentation just says [1,2,3,4,5] because sure, an array of five elements 1, 2, 3, 4, 5 that makes sense why use any other data structure?