From 0bdf385c57156b6e9d782fddb2dd6f2016cc0620 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 5 Apr 2016 22:36:06 -0400 Subject: Find "From: " line in input Look for the line that begins "From: " in the email message given to us. When we find it, we'll call a function that we're going to define soon that handles adding an alias to our Mutt aliases file. --- src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.rs b/src/main.rs index a30b4da..a0cca2c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,13 @@ fn main() { let stdin = io::stdin(); let input: Vec = stdin.lock().lines().map(|line| line.unwrap()).collect(); + for line in &input { + if line.starts_with("From: ") { + println!("!!!!!!!! {}", line); + // run matcher function + } + } + for l in &input { println!("{}", l); } -- cgit v1.2.3