diff --git a/src/extensions/idle.rs b/src/extensions/idle.rs index 4068fa7..6ee5b22 100644 --- a/src/extensions/idle.rs +++ b/src/extensions/idle.rs @@ -247,27 +247,27 @@ impl<'a, T: Read + Write + 'a> Drop for Handle<'a, T> { } } -impl<'a> SetReadTimeout for Connection { +impl SetReadTimeout for Connection { fn set_read_timeout(&mut self, timeout: Option) -> Result<()> { self.deref_mut().set_read_timeout(timeout) } } -impl<'a> SetReadTimeout for TcpStream { +impl SetReadTimeout for TcpStream { fn set_read_timeout(&mut self, timeout: Option) -> Result<()> { TcpStream::set_read_timeout(self, timeout).map_err(Error::Io) } } #[cfg(feature = "native-tls")] -impl<'a> SetReadTimeout for TlsStream { +impl SetReadTimeout for TlsStream { fn set_read_timeout(&mut self, timeout: Option) -> Result<()> { self.get_ref().set_read_timeout(timeout).map_err(Error::Io) } } #[cfg(feature = "rustls-tls")] -impl<'a> SetReadTimeout for RustlsStream { +impl SetReadTimeout for RustlsStream { fn set_read_timeout(&mut self, timeout: Option) -> Result<()> { self.get_ref().set_read_timeout(timeout).map_err(Error::Io) } diff --git a/src/extensions/list_status.rs b/src/extensions/list_status.rs index 3715288..713c299 100644 --- a/src/extensions/list_status.rs +++ b/src/extensions/list_status.rs @@ -32,7 +32,7 @@ impl ExtendedNames { ExtendedNamesTryBuilder { data: owned, extended_names_builder: |input| { - let mut lines: &[u8] = &input; + let mut lines: &[u8] = input; let mut names = Vec::new(); let mut current_name: Option> = None; let mut current_mailbox: Option = None; diff --git a/src/extensions/metadata.rs b/src/extensions/metadata.rs index 645bbf4..4591471 100644 --- a/src/extensions/metadata.rs +++ b/src/extensions/metadata.rs @@ -33,12 +33,12 @@ impl CmdListItemFormat for Metadata { "{} {}", validate_str( synopsis, - &format!("entry#{}", item_index + 1), + format!("entry#{}", item_index + 1), self.entry.as_str() )?, self.value .as_ref() - .map(|v| validate_str(synopsis, &format!("value#{}", item_index + 1), v.as_str())) + .map(|v| validate_str(synopsis, format!("value#{}", item_index + 1), v.as_str())) .unwrap_or_else(|| Ok("NIL".to_string()))? )) } diff --git a/src/types/acls.rs b/src/types/acls.rs index edfb486..cf89fef 100644 --- a/src/types/acls.rs +++ b/src/types/acls.rs @@ -162,12 +162,12 @@ pub struct Acl<'a> { impl<'a> Acl<'a> { /// Return the mailbox the ACL entries belong to pub fn mailbox(&self) -> &str { - &*self.mailbox + &self.mailbox } /// Returns a list of identifier/rights pairs for the mailbox pub fn acls(&self) -> &[AclEntry<'_>] { - &*self.acls + &self.acls } } @@ -244,12 +244,12 @@ pub struct ListRights<'a> { impl ListRights<'_> { /// Returns the mailbox for the rights pub fn mailbox(&self) -> &str { - &*self.mailbox + &self.mailbox } /// Returns the user identifier for the rights pub fn identifier(&self) -> &str { - &*self.identifier + &self.identifier } /// Returns the set of rights that are always provided for this identifier @@ -318,7 +318,7 @@ pub struct MyRights<'a> { impl MyRights<'_> { /// Returns the mailbox for the rights pub fn mailbox(&self) -> &str { - &*self.mailbox + &self.mailbox } /// Returns the rights for the mailbox diff --git a/src/types/capabilities.rs b/src/types/capabilities.rs index 966ce15..d79cc37 100644 --- a/src/types/capabilities.rs +++ b/src/types/capabilities.rs @@ -64,7 +64,7 @@ impl Capabilities { } /// Check if the server has the given capability. - pub fn has<'a>(&self, cap: &Capability<'a>) -> bool { + pub fn has(&self, cap: &Capability<'_>) -> bool { self.borrow_capabilities().contains(cap) } diff --git a/src/types/deleted.rs b/src/types/deleted.rs index cfc7aea..c84d94c 100644 --- a/src/types/deleted.rs +++ b/src/types/deleted.rs @@ -64,7 +64,7 @@ impl Deleted { pub fn from_expunged(v: Vec, mod_seq: Option) -> Self { Self { messages: DeletedMessages::Expunged(v), - mod_seq: mod_seq, + mod_seq, } } @@ -73,7 +73,7 @@ impl Deleted { pub fn from_vanished(v: Vec>, mod_seq: Option) -> Self { Self { messages: DeletedMessages::Vanished(v), - mod_seq: mod_seq, + mod_seq, } } diff --git a/src/types/name.rs b/src/types/name.rs index c068782..9a2c955 100644 --- a/src/types/name.rs +++ b/src/types/name.rs @@ -92,7 +92,7 @@ impl<'a> Name<'a> { /// the name is also valid as an argument for commands, such as `SELECT`, that accept mailbox /// names. pub fn name(&self) -> &str { - &*self.name + &self.name } /// Get an owned version of this [`Name`]. diff --git a/src/types/quota.rs b/src/types/quota.rs index ac9d5e8..8cbda63 100644 --- a/src/types/quota.rs +++ b/src/types/quota.rs @@ -234,7 +234,7 @@ impl QuotaRootResponse { /// The mailbox name pub fn mailbox_name(&self) -> &str { - &*self.borrow_inner().quota_root.mailbox_name + &self.borrow_inner().quota_root.mailbox_name } /// The list of quota roots for the mailbox name (could be empty) @@ -243,7 +243,7 @@ impl QuotaRootResponse { .quota_root .quota_root_names .iter() - .map(|e| &*e.as_ref()) + .map(|e| e.as_ref()) } /// The set of quotas for each named quota root (could be empty)