Skip to content

Instantly share code, notes, and snippets.

@thinktainer
Created February 23, 2018 17:37
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 thinktainer/31dfb5072a8cb13e35b35c1e3935a7b1 to your computer and use it in GitHub Desktop.
Save thinktainer/31dfb5072a8cb13e35b35c1e3935a7b1 to your computer and use it in GitHub Desktop.
let mut output: Box<io::Write> = match matches.value_of("out") {
Some(o) if o == "-" => Box::new(io::stdout()),
Some(o) => Box::new(File::create(&Path::new(o)).unwrap()),
None => Box::new(io::stdout()),
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment