Skip to content

Instantly share code, notes, and snippets.

@rochacbruno
Last active June 28, 2020 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rochacbruno/262828f17430cda4e06bc978393868c8 to your computer and use it in GitHub Desktop.
Save rochacbruno/262828f17430cda4e06bc978393868c8 to your computer and use it in GitHub Desktop.
fn main() {
let vec_opt = [Some(1), Some(2), Some(3)].iter().copied().collect::<Vec<Option<i32>>>();
let opt_vec = [Some(1), Some(2), Some(3)].iter().copied().collect::<Option<Vec<i32>>>();
println!("{:?}", vec_opt);
println!("{:?}", opt_vec);
}
@daidai21
Copy link

Is Python language?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment