Skip to content

Instantly share code, notes, and snippets.

@glguy
Created June 25, 2018 17:28
Show Gist options
  • Save glguy/ff4ad6a2ce55ef8cfac5440d1ceb23a0 to your computer and use it in GitHub Desktop.
Save glguy/ff4ad6a2ce55ef8cfac5440d1ceb23a0 to your computer and use it in GitHub Desktop.
fn main() {
let mut v = vec![false,false,true,false];
for x in &mut v {
if *x { break }
*x = true;
}
println!("{:?}", v);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment