Skip to content

Instantly share code, notes, and snippets.

@MatejLach
Created July 29, 2014 15:35
Show Gist options
  • Save MatejLach/0618e0a668ac47e29b4a to your computer and use it in GitHub Desktop.
Save MatejLach/0618e0a668ac47e29b4a to your computer and use it in GitHub Desktop.
An example of a nested for/while loop in Rust...
fn main() {
let lang = "Rust";
let rust_is_amazing = true;
let mut count = 0i;
for _ in range(0i, 5) {
while count < 10 && rust_is_amazing == true {
println!("Is, {} amazing? {}", lang, rust_is_amazing);
count += 1;
}
count = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment