aboutsummaryrefslogtreecommitdiff
path: root/src/imap/attributes.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-01-18 18:03:21 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-01-18 18:03:21 +0100
commit2c5adc8f166c6117ece353376b9071f5e30857b1 (patch)
tree1590c1277342734ee6f06b1a388c0fc63ecd8acf /src/imap/attributes.rs
parent43b668531f060a2c0f950da96b363b2ea7cf4e06 (diff)
downloadaerogramme-2c5adc8f166c6117ece353376b9071f5e30857b1.tar.gz
aerogramme-2c5adc8f166c6117ece353376b9071f5e30857b1.zip
reformat code
Diffstat (limited to 'src/imap/attributes.rs')
-rw-r--r--src/imap/attributes.rs50
1 files changed, 26 insertions, 24 deletions
diff --git a/src/imap/attributes.rs b/src/imap/attributes.rs
index d094f1a..89446a8 100644
--- a/src/imap/attributes.rs
+++ b/src/imap/attributes.rs
@@ -1,5 +1,5 @@
-use imap_codec::imap_types::fetch::{MacroOrMessageDataItemNames, MessageDataItemName, Section};
use imap_codec::imap_types::command::FetchModifier;
+use imap_codec::imap_types::fetch::{MacroOrMessageDataItemNames, MessageDataItemName, Section};
/// Internal decisions based on fetched attributes
/// passed by the client
@@ -8,7 +8,11 @@ pub struct AttributesProxy {
pub attrs: Vec<MessageDataItemName<'static>>,
}
impl AttributesProxy {
- pub fn new(attrs: &MacroOrMessageDataItemNames<'static>, modifiers: &[FetchModifier], is_uid_fetch: bool) -> Self {
+ pub fn new(
+ attrs: &MacroOrMessageDataItemNames<'static>,
+ modifiers: &[FetchModifier],
+ is_uid_fetch: bool,
+ ) -> Self {
// Expand macros
let mut fetch_attrs = match attrs {
MacroOrMessageDataItemNames::Macro(m) => {
@@ -44,32 +48,30 @@ impl AttributesProxy {
}
pub fn is_enabling_condstore(&self) -> bool {
- self.attrs.iter().any(|x| {
- matches!(x, MessageDataItemName::ModSeq)
- })
+ self.attrs
+ .iter()
+ .any(|x| matches!(x, MessageDataItemName::ModSeq))
}
pub fn need_body(&self) -> bool {
- self.attrs.iter().any(|x| {
- match x {
- MessageDataItemName::Body
- | MessageDataItemName::Rfc822
- | MessageDataItemName::Rfc822Text
- | MessageDataItemName::BodyStructure => true,
+ self.attrs.iter().any(|x| match x {
+ MessageDataItemName::Body
+ | MessageDataItemName::Rfc822
+ | MessageDataItemName::Rfc822Text
+ | MessageDataItemName::BodyStructure => true,
- MessageDataItemName::BodyExt {
- section: Some(section),
- partial: _,
- peek: _,
- } => match section {
- Section::Header(None)
- | Section::HeaderFields(None, _)
- | Section::HeaderFieldsNot(None, _) => false,
- _ => true,
- },
- MessageDataItemName::BodyExt { .. } => true,
- _ => false,
- }
+ MessageDataItemName::BodyExt {
+ section: Some(section),
+ partial: _,
+ peek: _,
+ } => match section {
+ Section::Header(None)
+ | Section::HeaderFields(None, _)
+ | Section::HeaderFieldsNot(None, _) => false,
+ _ => true,
+ },
+ MessageDataItemName::BodyExt { .. } => true,
+ _ => false,
})
}
}