From 1b65d6fd6dddae3a365459c7ea744cca3942b6d5 Mon Sep 17 00:00:00 2001 From: Dirk Van Haerenborgh Date: Mon, 5 Nov 2018 08:46:59 +0100 Subject: rustfmt --- tests/main.rs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'tests/main.rs') diff --git a/tests/main.rs b/tests/main.rs index 512aa84..4a81792 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -1,19 +1,20 @@ -extern crate notmuch; extern crate dirs; +extern crate notmuch; use std::sync::Arc; +use notmuch::{Query, QueryExt, Thread, Threads}; use notmuch::{StreamingIterator, StreamingIteratorExt}; -use notmuch::{Threads, Thread, Query, QueryExt}; fn main() { - let mut mail_path = dirs::home_dir().unwrap(); mail_path.push(".mail"); - match notmuch::Database::open(&mail_path.to_str().unwrap().to_string(), notmuch::DatabaseMode::ReadOnly){ + match notmuch::Database::open( + &mail_path.to_str().unwrap().to_string(), + notmuch::DatabaseMode::ReadOnly, + ) { Ok(db) => { - #[cfg(feature = "v0_21")] { let rev = db.revision(); @@ -25,23 +26,20 @@ fn main() { notmuch::Query::create(dbr.clone(), &"".to_string()).unwrap() }; - // let mut threads = query.search_threads().unwrap(); - - // let mut threads = db.create_query(&"".to_string()).unwrap().search_threads().unwrap(); let threads = Arc::new(::search_threads(query).unwrap()); - - while let Some(thread) = as StreamingIteratorExt>>>::next(threads.clone()) { + while let Some(thread) = as StreamingIteratorExt< + Thread>, + >>::next(threads.clone()) + { println!("thread {:?} {:?}", thread.subject(), thread.authors()); } - - - }, - Err(err) =>{ + } + Err(err) => { println!("Got error while trying to open db: {:?}", err); } } -- cgit v1.2.1