diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-05-15 18:23:23 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-05-15 18:23:23 +0200 |
commit | 9d6aef34add7a1bf32e754951a3d500721a2e626 (patch) | |
tree | ce7fffb46b9071b73a35620980cd25c060a7c908 /src/mail/user.rs | |
parent | 024d8df847ce720f0ec76b288c7a0142672d21f2 (diff) | |
download | aerogramme-9d6aef34add7a1bf32e754951a3d500721a2e626.tar.gz aerogramme-9d6aef34add7a1bf32e754951a3d500721a2e626.zip |
clippy lint fix
Diffstat (limited to 'src/mail/user.rs')
-rw-r--r-- | src/mail/user.rs | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/mail/user.rs b/src/mail/user.rs index d921e6d..44e0081 100644 --- a/src/mail/user.rs +++ b/src/mail/user.rs @@ -257,7 +257,7 @@ impl User { let saved; let (inbox_id, inbox_uidvalidity) = match list.create_mailbox(INBOX) { CreatedMailbox::Created(i, v) => { - self.save_mailbox_list(&list, ct.clone()).await?; + self.save_mailbox_list(list, ct.clone()).await?; saved = true; (i, v) } @@ -334,23 +334,17 @@ impl MailboxList { } fn has_mailbox(&self, name: &str) -> bool { - match self.0.get(name) { - Some(MailboxListEntry { - id_lww: (_, Some(_)), - .. - }) => true, - _ => false, - } + matches!(self.0.get(name), Some(MailboxListEntry { + id_lww: (_, Some(_)), + .. + })) } fn get_mailbox(&self, name: &str) -> Option<(ImapUidvalidity, Option<UniqueIdent>)> { - match self.0.get(name) { - None => None, - Some(MailboxListEntry { - id_lww: (_, mailbox_id), - uidvalidity, - }) => Some((*uidvalidity, *mailbox_id)), - } + self.0.get(name).map(|MailboxListEntry { + id_lww: (_, mailbox_id), + uidvalidity, + }| (*uidvalidity, *mailbox_id)) } /// Ensures mailbox `name` maps to id `id`. |