trpl-zh-cn/listings/ch13-functional-features/listing-13-27/src/main.rs

18 lines
351 B
Rust
Raw Normal View History

2022-02-06 16:43:51 +08:00
use std::env;
use std::process;
use minigrep::Config;
fn main() {
let config = Config::new(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);
}
}