Created
July 17, 2020 20:34
-
-
Save ryanpcmcquen/46d7a8449ce8d966623d0bce4fef9d89 to your computer and use it in GitHub Desktop.
Create an array with sequentially incremented items.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mut a = [0; 900]; | |
for (index, element) in a.iter_mut().enumerate() { | |
*element = index; | |
} | |
println!("{} {} {}", a[23], a[700], a[1]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment