melib/notmuch: fix compilation errors
parent
0b845a0d16
commit
6653357d54
|
@ -128,7 +128,11 @@ impl NotmuchDb {
|
|||
)
|
||||
};
|
||||
if status != 0 {
|
||||
return Err(MeliError::new(format!("Could not open notmuch database at path {}. notmuch_database_open returned {}.", s.root_folder.as_str(), status);
|
||||
return Err(MeliError::new(format!(
|
||||
"Could not open notmuch database at path {}. notmuch_database_open returned {}.",
|
||||
s.root_folder.as_str(),
|
||||
status
|
||||
)));
|
||||
}
|
||||
assert!(!database.is_null());
|
||||
let mut folders = FnvHashMap::default();
|
||||
|
@ -216,7 +220,10 @@ impl MailBackend for NotmuchDb {
|
|||
let query: *mut notmuch_query_t =
|
||||
unsafe { notmuch_query_create(*database_lck, query_str.as_ptr()) };
|
||||
if query.is_null() {
|
||||
tx.send(AsyncStatus::Payload(Err(MeliError::new("Could not create query. Out of memory?")))).unwrap();
|
||||
tx.send(AsyncStatus::Payload(Err(MeliError::new(
|
||||
"Could not create query. Out of memory?",
|
||||
))))
|
||||
.unwrap();
|
||||
tx.send(AsyncStatus::Finished).unwrap();
|
||||
return;
|
||||
}
|
||||
|
@ -224,7 +231,12 @@ impl MailBackend for NotmuchDb {
|
|||
let status =
|
||||
unsafe { notmuch_query_search_messages(query, &mut messages as *mut _) };
|
||||
if status != 0 {
|
||||
tx.send(AsyncStatus::Payload(Err(MeliError::new("Search for {} returned {}", folder.query_str.as_str(), status)))).unwrap();
|
||||
tx.send(AsyncStatus::Payload(Err(MeliError::new(format!(
|
||||
"Search for {} returned {}",
|
||||
folder.query_str.as_str(),
|
||||
status,
|
||||
)))))
|
||||
.unwrap();
|
||||
tx.send(AsyncStatus::Finished).unwrap();
|
||||
return;
|
||||
}
|
||||
|
@ -293,7 +305,8 @@ impl MailBackend for NotmuchDb {
|
|||
Ok(handle.thread().id())
|
||||
}
|
||||
fn folders(&self) -> Result<FnvHashMap<FolderHash, Folder>> {
|
||||
Ok(self.folders
|
||||
Ok(self
|
||||
.folders
|
||||
.read()
|
||||
.unwrap()
|
||||
.iter()
|
||||
|
|
Loading…
Reference in New Issue