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/imap/command/authenticated.rs | |
parent | 024d8df847ce720f0ec76b288c7a0142672d21f2 (diff) | |
download | aerogramme-9d6aef34add7a1bf32e754951a3d500721a2e626.tar.gz aerogramme-9d6aef34add7a1bf32e754951a3d500721a2e626.zip |
clippy lint fix
Diffstat (limited to 'src/imap/command/authenticated.rs')
-rw-r--r-- | src/imap/command/authenticated.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/imap/command/authenticated.rs b/src/imap/command/authenticated.rs index dc8b5a8..2deb723 100644 --- a/src/imap/command/authenticated.rs +++ b/src/imap/command/authenticated.rs @@ -25,7 +25,7 @@ pub struct AuthenticatedContext<'a> { pub user: &'a Arc<User>, } -pub async fn dispatch<'a>(ctx: AuthenticatedContext<'a>) -> Result<(Response, flow::Transition)> { +pub async fn dispatch(ctx: AuthenticatedContext<'_>) -> Result<(Response, flow::Transition)> { match &ctx.req.command.body { CommandBody::Create { mailbox } => ctx.create(mailbox).await, CommandBody::Delete { mailbox } => ctx.delete(mailbox).await, @@ -150,9 +150,7 @@ impl<'a> AuthenticatedContext<'a> { for (i, _) in mb.match_indices(MAILBOX_HIERARCHY_DELIMITER) { if i > 0 { let smb = &mb[..i]; - if !vmailboxes.contains_key(&smb) { - vmailboxes.insert(smb, false); - } + vmailboxes.entry(smb).or_insert(false); } } vmailboxes.insert(mb, true); @@ -160,7 +158,7 @@ impl<'a> AuthenticatedContext<'a> { let mut ret = vec![]; for (mb, is_real) in vmailboxes.iter() { - if matches_wildcard(&wildcard, &mb) { + if matches_wildcard(&wildcard, mb) { let mailbox = mb .to_string() .try_into() |