Created
April 8, 2022 18:59
-
-
Save jcar787/b54a06a6359832dfbee792ad1d272dc7 to your computer and use it in GitHub Desktop.
Using for with vectors in rust
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
fn main() { | |
let bands = vec!["Rush", "Black Sabbath", "Pink Floyd"]; | |
for band in bands.iter() { | |
println!("{} is one of my favorite bands", band); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment