diff options
| author | Teddy Wing | 2016-04-27 16:48:45 -0400 | 
|---|---|---|
| committer | Teddy Wing | 2016-04-27 16:48:45 -0400 | 
| commit | 665df66a7cd103b97dcd6667b02a051a797719a3 (patch) | |
| tree | 5068dff10300df3c7cb60b2e53fcf1a4213bbd40 /src | |
| parent | 55ddc252ff0fbbf4149afa6497b5fb407905ef52 (diff) | |
| parent | f45f00cbbe32d473deb4e23e8944a5a61e5f8e45 (diff) | |
| download | mutt-alias-auto-add-665df66a7cd103b97dcd6667b02a051a797719a3.tar.bz2 | |
Merge branch 'use-writer-for-STDOUT-instead-of-println'
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 9 | 
1 files changed, 2 insertions, 7 deletions
| 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();          }      }  } | 
