From 2e45a178a1c8a41c2d1d103f407aa912091b1dfa Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Fri, 12 May 2017 17:12:58 -0400 Subject: [PATCH] Skip OK Completed line --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 7506ac8..6a9494d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -187,10 +187,13 @@ fn main() { loop { // check current state of inbox - let unseen = imap_socket + let mut unseen = imap_socket .run_command_and_read_response("SEARCH UNSEEN") .unwrap(); + // remove last line of response (OK Completed) + unseen.pop(); + let mut num_unseen = 0; let mut uids = Vec::new(); let unseen = unseen.join(" ");