diff options
Diffstat (limited to 'tests/main.rs')
| -rw-r--r-- | tests/main.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/main.rs b/tests/main.rs index 6840dc0..d790e21 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -1,6 +1,8 @@ extern crate notmuch; extern crate dirs; +use notmuch::StreamingIterator; + fn main() { let mut mail_path = dirs::home_dir().unwrap(); @@ -18,15 +20,11 @@ fn main() { let query = db.create_query(&"".to_string()).unwrap(); let mut threads = query.search_threads().unwrap(); - loop { - match threads.next() { - Some(thread) => { - println!("thread {:?} {:?}", thread.subject(), thread.authors()); - }, - None => { break } - } + while let Some(thread) = threads.next() { + println!("thread {:?} {:?}", thread.subject(), thread.authors()); } + }, Err(err) =>{ println!("Got error while trying to open db: {:?}", err); |
