70 %

Collecting all environment variables in Rust

std::env::vars() gives us an iterator, which we can collect if we give a type signature to envs or as a turbofish.

rust
fn main() {
let envs: Vec<(String, String)> = std::env::vars().collect();
println!("{:?}", envs);
}