diff options
author | Adam Carpenter <53hornet@gmail.com> | 2019-02-28 09:21:32 -0500 |
---|---|---|
committer | Adam Carpenter <53hornet@gmail.com> | 2019-02-28 09:21:32 -0500 |
commit | 3cee41f4686cf7cfe4e12c29fd222be89f811f14 (patch) | |
tree | 3825e5863e6d6eb3122def39c18727a583c83e75 | |
parent | 131a4e22e2fb3afa8ec0a8a35945d9511e41a4f9 (diff) | |
download | learning-rust-3cee41f4686cf7cfe4e12c29fd222be89f811f14.tar.xz learning-rust-3cee41f4686cf7cfe4e12c29fd222be89f811f14.zip |
Added STDERR printing to minigrep.
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | minigrep/.gitignore | 3 | ||||
-rw-r--r-- | minigrep/src/main.rs | 4 |
3 files changed, 5 insertions, 5 deletions
@@ -1 +1,4 @@ */target/* +*.txt +Cargo.lock + diff --git a/minigrep/.gitignore b/minigrep/.gitignore deleted file mode 100644 index 12847b6..0000000 --- a/minigrep/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -target/ -Cargo.lock -*.txt diff --git a/minigrep/src/main.rs b/minigrep/src/main.rs index b1581c9..3cec101 100644 --- a/minigrep/src/main.rs +++ b/minigrep/src/main.rs @@ -7,11 +7,11 @@ use minigrep::Config; fn main() { let args: Vec<String> = env::args().collect(); let config = Config::new(&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); } } |