From 5d6e4f73322b26038e76e6f915c6c79c5f03566e Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 12 Jul 2022 15:31:29 +0200 Subject: cleanup --- src/imap/command/authenticated.rs | 8 ++++---- src/imap/command/examined.rs | 6 +++--- src/imap/command/selected.rs | 18 +++++++++--------- src/imap/mailbox_view.rs | 15 +++++++-------- 4 files changed, 23 insertions(+), 24 deletions(-) (limited to 'src/imap') diff --git a/src/imap/command/authenticated.rs b/src/imap/command/authenticated.rs index f46dfb4..e7198ee 100644 --- a/src/imap/command/authenticated.rs +++ b/src/imap/command/authenticated.rs @@ -165,21 +165,21 @@ impl<'a> AuthenticatedContext<'a> { async fn status( self, mailbox: &MailboxCodec, - attributes: &[StatusAttribute], + _attributes: &[StatusAttribute], ) -> Result<(Response, flow::Transition)> { - let name = String::try_from(mailbox.clone())?; + let _name = String::try_from(mailbox.clone())?; Ok((Response::bad("Not implemented")?, flow::Transition::None)) } async fn subscribe(self, mailbox: &MailboxCodec) -> Result<(Response, flow::Transition)> { - let name = String::try_from(mailbox.clone())?; + let _name = String::try_from(mailbox.clone())?; Ok((Response::bad("Not implemented")?, flow::Transition::None)) } async fn unsubscribe(self, mailbox: &MailboxCodec) -> Result<(Response, flow::Transition)> { - let name = String::try_from(mailbox.clone())?; + let _name = String::try_from(mailbox.clone())?; Ok(( Response::bad("Aerogramme does not support unsubscribing from a mailbox")?, diff --git a/src/imap/command/examined.rs b/src/imap/command/examined.rs index 91ad950..9dba680 100644 --- a/src/imap/command/examined.rs +++ b/src/imap/command/examined.rs @@ -71,9 +71,9 @@ impl<'a> ExaminedContext<'a> { pub async fn search( self, - charset: &Option, - criteria: &SearchKey, - uid: &bool, + _charset: &Option, + _criteria: &SearchKey, + _uid: &bool, ) -> Result<(Response, flow::Transition)> { Ok((Response::bad("Not implemented")?, flow::Transition::None)) } diff --git a/src/imap/command/selected.rs b/src/imap/command/selected.rs index bb78cbd..848302c 100644 --- a/src/imap/command/selected.rs +++ b/src/imap/command/selected.rs @@ -4,7 +4,7 @@ use anyhow::Result; use boitalettres::proto::Request; use boitalettres::proto::Response; use imap_codec::types::command::CommandBody; -use imap_codec::types::fetch_attributes::MacroOrFetchAttributes; + use imap_codec::types::flag::{Flag, StoreResponse, StoreType}; use imap_codec::types::mailbox::Mailbox as MailboxCodec; @@ -67,20 +67,20 @@ impl<'a> SelectedContext<'a> { async fn store( self, - sequence_set: &SequenceSet, - kind: &StoreType, - response: &StoreResponse, - flags: &[Flag], - uid: &bool, + _sequence_set: &SequenceSet, + _kind: &StoreType, + _response: &StoreResponse, + _flags: &[Flag], + _uid: &bool, ) -> Result<(Response, flow::Transition)> { Ok((Response::bad("Not implemented")?, flow::Transition::None)) } async fn copy( self, - sequence_set: &SequenceSet, - mailbox: &MailboxCodec, - uid: &bool, + _sequence_set: &SequenceSet, + _mailbox: &MailboxCodec, + _uid: &bool, ) -> Result<(Response, flow::Transition)> { Ok((Response::bad("Not implemented")?, flow::Transition::None)) } diff --git a/src/imap/mailbox_view.rs b/src/imap/mailbox_view.rs index b8fca53..a73bdf7 100644 --- a/src/imap/mailbox_view.rs +++ b/src/imap/mailbox_view.rs @@ -1,6 +1,5 @@ -use std::borrow::{Borrow, Cow}; -use std::collections::HashMap; -use std::io::{BufRead, Cursor}; +use std::borrow::Cow; + use std::num::NonZeroU32; use std::sync::Arc; @@ -10,7 +9,7 @@ use chrono::{Offset, TimeZone, Utc}; use futures::stream::{FuturesOrdered, StreamExt}; use imap_codec::types::address::Address; use imap_codec::types::body::{BasicFields, Body as FetchBody, BodyStructure, SpecificFields}; -use imap_codec::types::core::{Atom, IString, NString, NonZeroBytes}; +use imap_codec::types::core::{Atom, IString, NString}; use imap_codec::types::datetime::MyDateTime; use imap_codec::types::envelope::Envelope; use imap_codec::types::fetch_attributes::{FetchAttribute, MacroOrFetchAttributes}; @@ -287,9 +286,9 @@ impl MailboxView { build_imap_email_struct(&parsed, &parsed.structure)?, )), FetchAttribute::BodyExt { - section, - partial, - peek, + section: _, + partial: _, + peek: _, } => { // @TODO This is a stub let is = IString::try_from("test").unwrap(); @@ -579,7 +578,7 @@ fn build_imap_email_struct<'a>( }) } MessagePart::Binary(bp) | MessagePart::InlineBinary(bp) => { - let (_, mut basic) = headers_to_basic_fields(bp)?; + let (_, basic) = headers_to_basic_fields(bp)?; let ct = bp .get_content_type() -- cgit v1.2.3