notmuch: use faster, but inaccurate message count
This commit is contained in:
parent
fbc426f218
commit
a89a279764
@ -518,8 +518,10 @@ impl Notmuch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn count(&self, query: &str) -> Result<usize, NotmuchError> {
|
pub fn count(&self, query: &str) -> Result<usize, NotmuchError> {
|
||||||
// TODO: compare speed of notmuch count for * w/ and w/o --output=threads
|
// NOTE: --output=threads is technically more correct, but really slow
|
||||||
let res = self.run_notmuch(["count", "--output=threads", query])?;
|
// TODO: find a fast thread count path
|
||||||
|
// let res = self.run_notmuch(["count", "--output=threads", query])?;
|
||||||
|
let res = self.run_notmuch(["count", query])?;
|
||||||
// Strip '\n' from res.
|
// Strip '\n' from res.
|
||||||
let s = std::str::from_utf8(&res[..res.len() - 1])?;
|
let s = std::str::from_utf8(&res[..res.len() - 1])?;
|
||||||
Ok(s.parse()?)
|
Ok(s.parse()?)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user