Handle FETCH uids on multiple lines
This commit is contained in:
parent
fc5c58aefa
commit
e744077fa6
16
src/main.rs
16
src/main.rs
|
@ -191,16 +191,14 @@ fn main() {
|
||||||
|
|
||||||
let mut num_unseen = 0;
|
let mut num_unseen = 0;
|
||||||
let mut uids = Vec::new();
|
let mut uids = Vec::new();
|
||||||
for line in &unseen {
|
let unseen = unseen.join(" ");
|
||||||
for uid in line.split_whitespace()
|
let unseen = unseen.split_whitespace().skip(2);
|
||||||
.skip(2)
|
for uid in unseen.take_while(|&e| e != "" && e != "Completed") {
|
||||||
.take_while(|&e| e != "" && e != "Completed") {
|
if let Ok(uid) = usize::from_str_radix(uid, 10) {
|
||||||
if let Ok(uid) = usize::from_str_radix(uid, 10) {
|
if notified.insert(uid) {
|
||||||
if notified.insert(uid) {
|
uids.push(format!("{}", uid));
|
||||||
uids.push(format!("{}", uid));
|
|
||||||
}
|
|
||||||
num_unseen += 1;
|
|
||||||
}
|
}
|
||||||
|
num_unseen += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue