mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-02-24 21:32:15 +08:00
17 lines
348 B
Rust
17 lines
348 B
Rust
|
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);
|
||
|
}
|
||
|
}
|