diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-19 17:40:08 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-19 17:40:08 +0100 |
commit | f5f3aba8d1fb19fe11432e077817779b528363b7 (patch) | |
tree | eb834f87c179942aa64e108e53a4141d891edc39 /src/imap/mailbox_view.rs | |
parent | c2a518a997fa12f6e82b2a9eb1ba8cd6059fdf41 (diff) | |
download | aerogramme-f5f3aba8d1fb19fe11432e077817779b528363b7.tar.gz aerogramme-f5f3aba8d1fb19fe11432e077817779b528363b7.zip |
format code
Diffstat (limited to 'src/imap/mailbox_view.rs')
-rw-r--r-- | src/imap/mailbox_view.rs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/imap/mailbox_view.rs b/src/imap/mailbox_view.rs index f632df1..d57e9a3 100644 --- a/src/imap/mailbox_view.rs +++ b/src/imap/mailbox_view.rs @@ -237,20 +237,29 @@ impl MailboxView { self.update(UpdateParameters::default()).await } - pub async fn expunge(&mut self, maybe_seq_set: &Option<SequenceSet>) -> Result<Vec<Body<'static>>> { + pub async fn expunge( + &mut self, + maybe_seq_set: &Option<SequenceSet>, + ) -> Result<Vec<Body<'static>>> { // Get a recent view to apply our change self.internal.sync().await?; let state = self.internal.peek().await; let idx = Index::new(&state)?; - + // Build a default sequence set for the default case - use imap_codec::imap_types::sequence::{Sequence, SeqOrUid}; + use imap_codec::imap_types::sequence::{SeqOrUid, Sequence}; let seq = match maybe_seq_set { Some(s) => s.clone(), - None => SequenceSet(vec![Sequence::Range(SeqOrUid::Value(NonZeroU32::MIN), SeqOrUid::Asterisk)].try_into().unwrap()), + None => SequenceSet( + vec![Sequence::Range( + SeqOrUid::Value(NonZeroU32::MIN), + SeqOrUid::Asterisk, + )] + .try_into() + .unwrap(), + ), }; - let deleted_flag = Flag::Deleted.to_string(); let msgs = idx .fetch_on_uid(&seq) |