Handle FETCH uids on multiple lines

This commit is contained in:
Jon Gjengset 2017-05-03 21:39:23 -04:00
parent fc5c58aefa
commit e744077fa6
No known key found for this signature in database
GPG Key ID: D64AC9D67176DC71

View File

@ -191,16 +191,14 @@ fn main() {
let mut num_unseen = 0;
let mut uids = Vec::new();
for line in &unseen {
for uid in line.split_whitespace()
.skip(2)
.take_while(|&e| e != "" && e != "Completed") {
if let Ok(uid) = usize::from_str_radix(uid, 10) {
if notified.insert(uid) {
uids.push(format!("{}", uid));
}
num_unseen += 1;
let unseen = unseen.join(" ");
let unseen = unseen.split_whitespace().skip(2);
for uid in unseen.take_while(|&e| e != "" && e != "Completed") {
if let Ok(uid) = usize::from_str_radix(uid, 10) {
if notified.insert(uid) {
uids.push(format!("{}", uid));
}
num_unseen += 1;
}
}