diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-10 14:45:36 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-10 14:45:36 +0100 |
commit | 0c6e745d11725b4a15d2c380f5bb60067c26ddd9 (patch) | |
tree | 6e29c4012b75df51dd75afc32c8ac8bcd0070868 /src/imap/index.rs | |
parent | 20193aa023b3f6a6d24d8127f1d8dcb81a43aa3b (diff) | |
download | aerogramme-0c6e745d11725b4a15d2c380f5bb60067c26ddd9.tar.gz aerogramme-0c6e745d11725b4a15d2c380f5bb60067c26ddd9.zip |
update imap-codec
Diffstat (limited to 'src/imap/index.rs')
-rw-r--r-- | src/imap/index.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/imap/index.rs b/src/imap/index.rs index 95c16b3..da94022 100644 --- a/src/imap/index.rs +++ b/src/imap/index.rs @@ -1,7 +1,7 @@ use std::num::NonZeroU32; use anyhow::{anyhow, Result}; -use imap_codec::imap_types::sequence::{self, SeqOrUid, Sequence, SequenceSet}; +use imap_codec::imap_types::sequence::{SeqOrUid, Sequence, SequenceSet}; use crate::mail::uidindex::{ImapUid, UidIndex}; use crate::mail::unique_ident::UniqueIdent; @@ -61,10 +61,8 @@ impl<'a> Index<'a> { if self.imap_index.is_empty() { return vec![]; } - let iter_strat = sequence::Strategy::Naive { - largest: self.last().expect("The mailbox is not empty").uid, - }; - let mut unroll_seq = sequence_set.iter(iter_strat).collect::<Vec<_>>(); + let largest = self.last().expect("The mailbox is not empty").uid; + let mut unroll_seq = sequence_set.iter(largest).collect::<Vec<_>>(); unroll_seq.sort(); let start_seq = match unroll_seq.iter().next() { @@ -103,11 +101,9 @@ impl<'a> Index<'a> { if self.imap_index.is_empty() { return Ok(vec![]); } - let iter_strat = sequence::Strategy::Naive { - largest: NonZeroU32::try_from(self.imap_index.len() as u32)?, - }; + let largest = NonZeroU32::try_from(self.imap_index.len() as u32)?; let mut acc = sequence_set - .iter(iter_strat) + .iter(largest) .map(|wanted_id| { self.imap_index .get((wanted_id.get() as usize) - 1) |