gw_rust_programming_tutorial/chapter_12/
test_12_6.rs1use std::{env};
2
3
4pub fn test_err_to_stderr() {
5
6 parse_env();
7}
8
9fn parse_env() -> Result<(), &'static str> {
10 if env::vars().count() == 0 {
11 return Err("not enough arguments");
12 }
13
14 for (k,v) in env::vars() {
15 eprintln!("stderr:\t{}={}",k,v);
16 }
17
18 Ok(())
19}