aboutsummaryrefslogtreecommitdiff
path: root/src/imap/index.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-01-06 11:33:56 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-01-06 11:33:56 +0100
commit53dbf82cbce3cb17cbcffd09558677faf8702f54 (patch)
treeb78cca747e5c2bc004cb93b93536623f7abb6ef5 /src/imap/index.rs
parent1ca6cd5de0656910213425e1d8f05256af820f21 (diff)
downloadaerogramme-53dbf82cbce3cb17cbcffd09558677faf8702f54.tar.gz
aerogramme-53dbf82cbce3cb17cbcffd09558677faf8702f54.zip
Format code again
Diffstat (limited to 'src/imap/index.rs')
-rw-r--r--src/imap/index.rs25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/imap/index.rs b/src/imap/index.rs
index 347222c..01dd2ef 100644
--- a/src/imap/index.rs
+++ b/src/imap/index.rs
@@ -8,7 +8,11 @@ use crate::mail::unique_ident::UniqueIdent;
pub struct Index<'a>(pub &'a UidIndex);
impl<'a> Index<'a> {
- pub fn fetch(self: &Index<'a>, sequence_set: &SequenceSet, by_uid: bool) -> Result<Vec<MailIndex<'a>>> {
+ pub fn fetch(
+ self: &Index<'a>,
+ sequence_set: &SequenceSet,
+ by_uid: bool,
+ ) -> Result<Vec<MailIndex<'a>>> {
let mail_vec = self
.0
.idx_by_uid
@@ -37,7 +41,13 @@ impl<'a> Index<'a> {
i: NonZeroU32::try_from(i as u32 + 1).unwrap(),
uid: mail.0,
uuid: mail.1,
- flags: self.0.table.get(&mail.1).ok_or(anyhow!("mail is missing from index"))?.1.as_ref(),
+ flags: self
+ .0
+ .table
+ .get(&mail.1)
+ .ok_or(anyhow!("mail is missing from index"))?
+ .1
+ .as_ref(),
});
}
} else {
@@ -59,7 +69,13 @@ impl<'a> Index<'a> {
i,
uid: mail.0,
uuid: mail.1,
- flags: self.0.table.get(&mail.1).ok_or(anyhow!("mail is missing from index"))?.1.as_ref(),
+ flags: self
+ .0
+ .table
+ .get(&mail.1)
+ .ok_or(anyhow!("mail is missing from index"))?
+ .1
+ .as_ref(),
});
} else {
bail!("No such mail: {}", i);
@@ -68,7 +84,6 @@ impl<'a> Index<'a> {
}
Ok(mails)
-
}
}
@@ -76,5 +91,5 @@ pub struct MailIndex<'a> {
pub i: NonZeroU32,
pub uid: ImapUid,
pub uuid: UniqueIdent,
- pub flags: &'a Vec<String>
+ pub flags: &'a Vec<String>,
}