[Minigrep project] - redirecting the errors to stderr
This commit is contained in:
parent
2a31c81ee7
commit
7d2b213b47
@ -3,7 +3,7 @@ use std::env;
|
||||
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}");
|
||||
std::process::exit(1);
|
||||
});
|
||||
|
||||
@ -11,7 +11,7 @@ fn main() {
|
||||
println!("In file {}", config.file_path);
|
||||
|
||||
if let Err(e) = minigrep::run(config) {
|
||||
println!("Application error: {e}");
|
||||
eprintln!("Application error: {e}");
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user