diff options
| -rw-r--r-- | Makefile | 10 | ||||
| -rw-r--r-- | src/main.rs | 9 |
2 files changed, 12 insertions, 7 deletions
@@ -1,2 +1,12 @@ test-integration: + cargo build prove -v + +test: + cargo test + +test-all: test test-integration + +reinstall: + cargo uninstall alias-auto-add + cargo install diff --git a/src/main.rs b/src/main.rs index 1129ec7..8b9c93a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ //! person has multiple email addresses. use std::env; -use std::io::{self, BufRead, Write}; +use std::io::{self, BufRead}; mod alias; @@ -42,12 +42,7 @@ fn main() { if line.starts_with("From: ") { let mut alias = Alias::new(&line); - match alias.write_to_file(&file) { - Ok(_) => continue, - Err(e @ AliasSearchError::NotFound) | Err(e @ AliasSearchError::EmailExists) => - io::stderr().write(e.to_string().as_bytes()).ok(), - Err(e) => io::stderr().write(e.to_string().as_bytes()).ok(), - }; + alias.write_to_file(&file).ok(); } } } |
