notmuch: add bulk version of allmail::parse.

This commit is contained in:
2021-10-31 16:06:04 -07:00
parent 448cef15a8
commit 720621e19e
3 changed files with 67 additions and 7 deletions

View File

@@ -480,7 +480,8 @@ impl Notmuch {
pub fn show(&self, query: &str) -> Result<ThreadSet, NotmuchError> {
let slice = self.run_notmuch(["show", "--format=json", query])?;
//
// Notmuch returns JSON with invalid unicode. So we lossy convert it to a string here an
// use that for parsing in rust.
let s = String::from_utf8_lossy(&slice);
let mut deserializer = serde_json::Deserializer::from_str(&s);
deserializer.disable_recursion_limit();