Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created May 14, 2023 08:55
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 rust-play/5689af5322e9e26eb95458a159289f43 to your computer and use it in GitHub Desktop.
Save rust-play/5689af5322e9e26eb95458a159289f43 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
use std::env;
use std::process;
use minigrep::Config;
fn main() {
let config = Config::build(env::args()).unwrap_or_else(|err| {
eprintln!("Problem parsing arguments: {err}");
process::exit(1);
});
if let Err(e) = minigrep::run(config) {
eprintln!("Application error: {e}");
process::exit(1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment