Print errors to stderr

This commit is contained in:
Manuel Thalmann 2025-03-21 21:38:34 +01:00
parent 0c883413ce
commit 920dcf4ff7
Signed by: manuth
SSH key fingerprint: SHA256:HsMLC+7kJWALP6YCYCoopxNbUnghwSGLVcG76SECT5c

View file

@ -7,12 +7,12 @@ fn main() {
let args: Vec<String> = env::args().collect();
let config = Config::build(&args).unwrap_or_else(|err| {
println!("Problem parsing arguments: {err}");
eprintln!("Problem parsing arguments: {err}");
process::exit(1);
});
if let Err(e) = minigrep::run(config) {
println!("Application error: {e}");
eprintln!("Application error: {e}");
process::exit(1);
}
}