melib/notmuch: fix compilation errors
parent
0b845a0d16
commit
6653357d54
|
@ -128,7 +128,11 @@ impl NotmuchDb {
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
if status != 0 {
|
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());
|
assert!(!database.is_null());
|
||||||
let mut folders = FnvHashMap::default();
|
let mut folders = FnvHashMap::default();
|
||||||
|
@ -216,7 +220,10 @@ impl MailBackend for NotmuchDb {
|
||||||
let query: *mut notmuch_query_t =
|
let query: *mut notmuch_query_t =
|
||||||
unsafe { notmuch_query_create(*database_lck, query_str.as_ptr()) };
|
unsafe { notmuch_query_create(*database_lck, query_str.as_ptr()) };
|
||||||
if query.is_null() {
|
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();
|
tx.send(AsyncStatus::Finished).unwrap();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -224,7 +231,12 @@ impl MailBackend for NotmuchDb {
|
||||||
let status =
|
let status =
|
||||||
unsafe { notmuch_query_search_messages(query, &mut messages as *mut _) };
|
unsafe { notmuch_query_search_messages(query, &mut messages as *mut _) };
|
||||||
if status != 0 {
|
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();
|
tx.send(AsyncStatus::Finished).unwrap();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -293,7 +305,8 @@ impl MailBackend for NotmuchDb {
|
||||||
Ok(handle.thread().id())
|
Ok(handle.thread().id())
|
||||||
}
|
}
|
||||||
fn folders(&self) -> Result<FnvHashMap<FolderHash, Folder>> {
|
fn folders(&self) -> Result<FnvHashMap<FolderHash, Folder>> {
|
||||||
Ok(self.folders
|
Ok(self
|
||||||
|
.folders
|
||||||
.read()
|
.read()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.iter()
|
.iter()
|
||||||
|
|
Loading…
Reference in New Issue