The inclusive range (..=) that I've used is available from Rust 1.24. It will work with previous versions. But you can change it from (0..=1_000_000) to (0..1_000_001) and it should work in any previous version.
repl.it uses Rust 1.9, the for_each method for iterator is avalable from 1.21 onwards. You can save the filtered list and call for loop on elements.
Here's the repl.it link with formatted code, that will work over there. link
If you want to run the newer version, here's a link to rust playground with the code.
Have fun 😃
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The inclusive range (..=) that I've used is available from Rust 1.24. It will work with previous versions. But you can change it from
(0..=1_000_000)
to(0..1_000_001)
and it should work in any previous version.repl.it uses Rust 1.9, the
for_each
method for iterator is avalable from 1.21 onwards. You can save the filtered list and callfor
loop on elements.Here's the repl.it link with formatted code, that will work over there. link
If you want to run the newer version, here's a link to rust playground with the code.
Have fun 😃