aboutsummaryrefslogtreecommitdiff
path: root/src/imap/search.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-01-08 11:13:13 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-01-08 11:13:13 +0100
commit558e32fbd27be9a81144571b4baf318293be1344 (patch)
tree238e785d2c72dfff6015f78a340246750e45e4a2 /src/imap/search.rs
parent35fd24ee46d8162cffe3aebcb32d0db1f35bd220 (diff)
downloadaerogramme-558e32fbd27be9a81144571b4baf318293be1344.tar.gz
aerogramme-558e32fbd27be9a81144571b4baf318293be1344.zip
UID sequence are now correctly fetched
Diffstat (limited to 'src/imap/search.rs')
-rw-r--r--src/imap/search.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/imap/search.rs b/src/imap/search.rs
index 2b0b34b..22afd0c 100644
--- a/src/imap/search.rs
+++ b/src/imap/search.rs
@@ -117,13 +117,13 @@ impl<'a> Criteria<'a> {
/// fetching some remote data
pub fn filter_on_idx<'b>(
&self,
- midx_list: &[MailIndex<'b>],
- ) -> (Vec<MailIndex<'b>>, Vec<MailIndex<'b>>) {
+ midx_list: &[&'b MailIndex<'b>],
+ ) -> (Vec<&'b MailIndex<'b>>, Vec<&'b MailIndex<'b>>) {
let (p1, p2): (Vec<_>, Vec<_>) = midx_list
.iter()
.map(|x| (x, self.is_keep_on_idx(x)))
.filter(|(_midx, decision)| decision.is_keep())
- .map(|(midx, decision)| ((*midx).clone(), decision))
+ .map(|(midx, decision)| (*midx, decision))
.partition(|(_midx, decision)| matches!(decision, PartialDecision::Keep));
let to_keep = p1.into_iter().map(|(v, _)| v).collect();
@@ -133,13 +133,13 @@ impl<'a> Criteria<'a> {
pub fn filter_on_query<'b>(
&self,
- midx_list: &[MailIndex<'b>],
+ midx_list: &[&'b MailIndex<'b>],
query_result: &'b Vec<QueryResult<'b>>,
- ) -> Result<Vec<MailIndex<'b>>> {
+ ) -> Result<Vec<&'b MailIndex<'b>>> {
Ok(midx_list
.iter()
.zip(query_result.iter())
- .map(|(midx, qr)| MailView::new(qr, midx.clone()))
+ .map(|(midx, qr)| MailView::new(qr, midx))
.collect::<Result<Vec<_>, _>>()?
.into_iter()
.filter(|mail_view| self.is_keep_on_query(mail_view))