diff --git a/src/base/charstr.rs b/src/base/charstr.rs index b47743c33..0a0361dce 100644 --- a/src/base/charstr.rs +++ b/src/base/charstr.rs @@ -911,7 +911,7 @@ impl<'a> Iter<'a> { } } -impl<'a> Iterator for Iter<'a> { +impl Iterator for Iter<'_> { type Item = u8; fn next(&mut self) -> Option { @@ -929,7 +929,7 @@ impl<'a> Iterator for Iter<'a> { #[derive(Clone, Copy, Debug)] pub struct DisplayQuoted<'a>(&'a CharStr<[u8]>); -impl<'a> fmt::Display for DisplayQuoted<'a> { +impl fmt::Display for DisplayQuoted<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("\"")?; for &ch in self.0.as_ref() { @@ -947,7 +947,7 @@ impl<'a> fmt::Display for DisplayQuoted<'a> { #[derive(Clone, Copy, Debug)] pub struct DisplayUnquoted<'a>(&'a CharStr<[u8]>); -impl<'a> fmt::Display for DisplayUnquoted<'a> { +impl fmt::Display for DisplayUnquoted<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { for &ch in self.0.as_ref() { fmt::Display::fmt(&Symbol::from_octet(ch), f)?; @@ -978,8 +978,8 @@ impl<'a, Builder> DeserializeCharStrSeed<'a, Builder> { } #[cfg(feature = "serde")] -impl<'de, 'a, Builder> serde::de::DeserializeSeed<'de> - for DeserializeCharStrSeed<'a, Builder> +impl<'de, Builder> serde::de::DeserializeSeed<'de> + for DeserializeCharStrSeed<'_, Builder> where Builder: OctetsBuilder + AsMut<[u8]>, { @@ -1000,7 +1000,7 @@ where DeserializeCharStrSeed<'a, Builder>, ); - impl<'de, 'a, Builder> serde::de::Visitor<'de> for NewtypeVisitor<'a, Builder> + impl<'de, Builder> serde::de::Visitor<'de> for NewtypeVisitor<'_, Builder> where Builder: OctetsBuilder + AsMut<[u8]>, { @@ -1027,8 +1027,7 @@ where DeserializeCharStrSeed<'a, Builder>, ); - impl<'de, 'a, Builder> serde::de::Visitor<'de> - for ReadableVisitor<'a, Builder> + impl serde::de::Visitor<'_> for ReadableVisitor<'_, Builder> where Builder: OctetsBuilder + AsMut<[u8]>, { @@ -1065,7 +1064,7 @@ where DeserializeCharStrSeed<'a, Builder>, ); - impl<'de, 'a, Builder> serde::de::Visitor<'de> for BinaryVisitor<'a, Builder> + impl serde::de::Visitor<'_> for BinaryVisitor<'_, Builder> where Builder: OctetsBuilder, { diff --git a/src/base/dig_printer.rs b/src/base/dig_printer.rs index 426b8dc37..3983f05fa 100644 --- a/src/base/dig_printer.rs +++ b/src/base/dig_printer.rs @@ -13,7 +13,7 @@ pub(super) struct DigPrinter<'a, Octs> { pub msg: &'a Message, } -impl<'a, Octs: AsRef<[u8]>> fmt::Display for DigPrinter<'a, Octs> { +impl> fmt::Display for DigPrinter<'_, Octs> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let msg = self.msg.for_slice_ref(); diff --git a/src/base/message.rs b/src/base/message.rs index 7fba1fae6..c26839ece 100644 --- a/src/base/message.rs +++ b/src/base/message.rs @@ -819,13 +819,13 @@ impl<'a, Octs: Octets + ?Sized> QuestionSection<'a, Octs> { //--- Clone and Clone -impl<'a, Octs: ?Sized> Clone for QuestionSection<'a, Octs> { +impl Clone for QuestionSection<'_, Octs> { fn clone(&self) -> Self { *self } } -impl<'a, Octs: ?Sized> Copy for QuestionSection<'a, Octs> {} +impl Copy for QuestionSection<'_, Octs> {} //--- Iterator @@ -852,8 +852,8 @@ impl<'a, Octs: Octets + ?Sized> Iterator for QuestionSection<'a, Octs> { //--- PartialEq -impl<'a, 'o, Octs, Other> PartialEq> - for QuestionSection<'a, Octs> +impl<'o, Octs, Other> PartialEq> + for QuestionSection<'_, Octs> where Octs: Octets + ?Sized, Other: Octets + ?Sized, @@ -1056,13 +1056,13 @@ impl<'a, Octs: Octets + ?Sized> RecordSection<'a, Octs> { //--- Clone and Copy -impl<'a, Octs: ?Sized> Clone for RecordSection<'a, Octs> { +impl Clone for RecordSection<'_, Octs> { fn clone(&self) -> Self { *self } } -impl<'a, Octs: ?Sized> Copy for RecordSection<'a, Octs> {} +impl Copy for RecordSection<'_, Octs> {} //--- Iterator @@ -1182,7 +1182,7 @@ where //--- Clone -impl<'a, Octs: ?Sized, Data> Clone for RecordIter<'a, Octs, Data> { +impl Clone for RecordIter<'_, Octs, Data> { fn clone(&self) -> Self { RecordIter { section: self.section, @@ -1273,7 +1273,7 @@ where //--- Clone -impl<'a, Octs: ?Sized, Data> Clone for AnyRecordIter<'a, Octs, Data> { +impl Clone for AnyRecordIter<'_, Octs, Data> { fn clone(&self) -> Self { Self { section: self.section, diff --git a/src/base/name/absolute.rs b/src/base/name/absolute.rs index bf8b20d8e..22bb0fbb0 100644 --- a/src/base/name/absolute.rs +++ b/src/base/name/absolute.rs @@ -880,7 +880,10 @@ impl ToLabelIter for Name where Octs: AsRef<[u8]> + ?Sized, { - type LabelIter<'a> = NameIter<'a> where Octs: 'a; + type LabelIter<'a> + = NameIter<'a> + where + Octs: 'a; fn iter_labels(&self) -> Self::LabelIter<'_> { self.iter() diff --git a/src/base/name/chain.rs b/src/base/name/chain.rs index 04b7d76f0..8a0325963 100644 --- a/src/base/name/chain.rs +++ b/src/base/name/chain.rs @@ -126,7 +126,11 @@ impl Chain { //--- ToLabelIter, ToRelativeName, ToName impl ToLabelIter for Chain { - type LabelIter<'a> = ChainIter<'a, L, R> where L: 'a, R: 'a; + type LabelIter<'a> + = ChainIter<'a, L, R> + where + L: 'a, + R: 'a; fn iter_labels(&self) -> Self::LabelIter<'_> { ChainIter(self.left.iter_labels().chain(self.right.iter_labels())) @@ -145,8 +149,11 @@ where Octs: AsRef<[u8]>, R: ToName, { - type LabelIter<'a> = UncertainChainIter<'a, Octs, R> - where Octs: 'a, R: 'a; + type LabelIter<'a> + = UncertainChainIter<'a, Octs, R> + where + Octs: 'a, + R: 'a; fn iter_labels(&self) -> Self::LabelIter<'_> { match self.left { @@ -241,7 +248,7 @@ pub struct ChainIter<'a, L: ToLabelIter + 'a, R: ToLabelIter + 'a>( iter::Chain, R::LabelIter<'a>>, ); -impl<'a, L, R> Clone for ChainIter<'a, L, R> +impl Clone for ChainIter<'_, L, R> where L: ToLabelIter, R: ToLabelIter, @@ -263,7 +270,7 @@ where } } -impl<'a, L, R> DoubleEndedIterator for ChainIter<'a, L, R> +impl DoubleEndedIterator for ChainIter<'_, L, R> where L: ToLabelIter, R: ToLabelIter, @@ -281,7 +288,7 @@ pub enum UncertainChainIter<'a, Octets: AsRef<[u8]>, R: ToLabelIter> { Relative(ChainIter<'a, UncertainName, R>), } -impl<'a, Octets, R> Clone for UncertainChainIter<'a, Octets, R> +impl Clone for UncertainChainIter<'_, Octets, R> where Octets: AsRef<[u8]>, R: ToLabelIter, @@ -311,7 +318,7 @@ where } } -impl<'a, Octets, R> DoubleEndedIterator for UncertainChainIter<'a, Octets, R> +impl DoubleEndedIterator for UncertainChainIter<'_, Octets, R> where Octets: AsRef<[u8]>, R: ToLabelIter, @@ -328,7 +335,7 @@ where struct DisplayWithDot<'a, L, R>(&'a Chain); -impl<'a, L, R> fmt::Display for DisplayWithDot<'a, L, R> +impl fmt::Display for DisplayWithDot<'_, L, R> where Chain: ToLabelIter, { diff --git a/src/base/name/parsed.rs b/src/base/name/parsed.rs index 33b629d65..7a2e13124 100644 --- a/src/base/name/parsed.rs +++ b/src/base/name/parsed.rs @@ -455,7 +455,10 @@ impl> hash::Hash for ParsedName { //--- ToLabelIter and ToName impl> ToLabelIter for ParsedName { - type LabelIter<'s> = ParsedNameIter<'s> where Octs: 's; + type LabelIter<'s> + = ParsedNameIter<'s> + where + Octs: 's; fn iter_labels(&self) -> Self::LabelIter<'_> { self.iter() diff --git a/src/base/name/relative.rs b/src/base/name/relative.rs index e568d7f85..1bdbd3ea4 100644 --- a/src/base/name/relative.rs +++ b/src/base/name/relative.rs @@ -637,7 +637,10 @@ impl ToLabelIter for RelativeName where Octs: AsRef<[u8]> + ?Sized, { - type LabelIter<'a> = NameIter<'a> where Octs: 'a; + type LabelIter<'a> + = NameIter<'a> + where + Octs: 'a; fn iter_labels(&self) -> Self::LabelIter<'_> { self.iter() @@ -926,7 +929,7 @@ impl<'a> Iterator for NameIter<'a> { } } -impl<'a> DoubleEndedIterator for NameIter<'a> { +impl DoubleEndedIterator for NameIter<'_> { fn next_back(&mut self) -> Option { if self.slice.is_empty() { return None; diff --git a/src/base/name/traits.rs b/src/base/name/traits.rs index 47da86f59..42f081600 100644 --- a/src/base/name/traits.rs +++ b/src/base/name/traits.rs @@ -81,7 +81,11 @@ pub trait ToLabelIter { } impl<'r, N: ToLabelIter + ?Sized> ToLabelIter for &'r N { - type LabelIter<'a> = N::LabelIter<'a> where 'r: 'a, N: 'a; + type LabelIter<'a> + = N::LabelIter<'a> + where + 'r: 'a, + N: 'a; fn iter_labels(&self) -> Self::LabelIter<'_> { (*self).iter_labels() @@ -351,7 +355,7 @@ pub trait ToName: ToLabelIter { pub struct DisplayWithDot<'a, T: ?Sized>(&'a T); -impl<'a, T> fmt::Display for DisplayWithDot<'a, T> +impl fmt::Display for DisplayWithDot<'_, T> where T: ToLabelIter + ?Sized, { diff --git a/src/base/name/uncertain.rs b/src/base/name/uncertain.rs index 666465c11..50ab50389 100644 --- a/src/base/name/uncertain.rs +++ b/src/base/name/uncertain.rs @@ -379,7 +379,10 @@ impl> hash::Hash for UncertainName { //--- ToLabelIter impl> ToLabelIter for UncertainName { - type LabelIter<'a> = NameIter<'a> where Octs: 'a; + type LabelIter<'a> + = NameIter<'a> + where + Octs: 'a; fn iter_labels(&self) -> Self::LabelIter<'_> { match *self { diff --git a/src/base/opt/algsig.rs b/src/base/opt/algsig.rs index a4f6172b3..d00159342 100644 --- a/src/base/opt/algsig.rs +++ b/src/base/opt/algsig.rs @@ -474,7 +474,7 @@ impl Opt { } } -impl<'a, Target: Composer> OptBuilder<'a, Target> { +impl OptBuilder<'_, Target> { /// Appends a DAU option. /// /// The DAU option lists the DNSSEC signature algorithms the requester @@ -538,7 +538,7 @@ impl<'a> SecAlgsIter<'a> { } } -impl<'a> Iterator for SecAlgsIter<'a> { +impl Iterator for SecAlgsIter<'_> { type Item = SecAlg; fn next(&mut self) -> Option { diff --git a/src/base/opt/chain.rs b/src/base/opt/chain.rs index a5b83c5c8..7ab2beb38 100644 --- a/src/base/opt/chain.rs +++ b/src/base/opt/chain.rs @@ -199,7 +199,7 @@ impl Opt { } } -impl<'a, Target: Composer> OptBuilder<'a, Target> { +impl OptBuilder<'_, Target> { /// Appends the CHAIN option. /// /// The CHAIN option allows a client to request that all records that diff --git a/src/base/opt/cookie.rs b/src/base/opt/cookie.rs index 6c373a19b..912b3ef1a 100644 --- a/src/base/opt/cookie.rs +++ b/src/base/opt/cookie.rs @@ -239,7 +239,7 @@ impl Opt { } } -impl<'a, Target: Composer> OptBuilder<'a, Target> { +impl OptBuilder<'_, Target> { /// Appends a new cookie option. pub fn cookie( &mut self, cookie: Cookie, diff --git a/src/base/opt/expire.rs b/src/base/opt/expire.rs index 573c5e4e3..ed0fd591a 100644 --- a/src/base/opt/expire.rs +++ b/src/base/opt/expire.rs @@ -131,7 +131,7 @@ impl Opt { } } -impl<'a, Target: Composer> OptBuilder<'a, Target> { +impl OptBuilder<'_, Target> { /// Appends the Expire option. /// /// The Expire option allows an authoritative server to signal its own diff --git a/src/base/opt/exterr.rs b/src/base/opt/exterr.rs index bee781ae1..a462080f4 100644 --- a/src/base/opt/exterr.rs +++ b/src/base/opt/exterr.rs @@ -315,7 +315,7 @@ impl Opt { } } -impl<'a, Target: Composer> OptBuilder<'a, Target> { +impl OptBuilder<'_, Target> { /// Appends an extended DNS error option. /// /// The extended DNS error option carries additional error information in diff --git a/src/base/opt/keepalive.rs b/src/base/opt/keepalive.rs index 28ab443f9..c8fc79862 100644 --- a/src/base/opt/keepalive.rs +++ b/src/base/opt/keepalive.rs @@ -131,7 +131,7 @@ impl Opt { } } -impl<'a, Target: Composer> OptBuilder<'a, Target> { +impl OptBuilder<'_, Target> { pub fn tcp_keepalive( &mut self, timeout: Option ) -> Result<(), Target::AppendError> { diff --git a/src/base/opt/keytag.rs b/src/base/opt/keytag.rs index 79316252c..8c9014a4e 100644 --- a/src/base/opt/keytag.rs +++ b/src/base/opt/keytag.rs @@ -323,7 +323,7 @@ impl Opt { } } -impl<'a, Target: Composer> OptBuilder<'a, Target> { +impl OptBuilder<'_, Target> { /// Appends a edns-key-tag option. /// /// The option contains a list of the key tags of the trust anchor keys @@ -363,7 +363,7 @@ impl> serde::Serialize for KeyTag { #[derive(Clone, Copy, Debug)] pub struct KeyTagIter<'a>(&'a [u8]); -impl<'a> Iterator for KeyTagIter<'a> { +impl Iterator for KeyTagIter<'_> { type Item = u16; fn next(&mut self) -> Option { diff --git a/src/base/opt/nsid.rs b/src/base/opt/nsid.rs index 4711e7873..259df0b31 100644 --- a/src/base/opt/nsid.rs +++ b/src/base/opt/nsid.rs @@ -283,7 +283,7 @@ impl Opt { } } -impl<'a, Target: Composer> OptBuilder<'a, Target> { +impl OptBuilder<'_, Target> { /// Appends an NSID option with the given server identifier. /// /// The NSID option contains an identifier for the name server that diff --git a/src/base/opt/padding.rs b/src/base/opt/padding.rs index 8d0c05d1b..57df2871b 100644 --- a/src/base/opt/padding.rs +++ b/src/base/opt/padding.rs @@ -179,7 +179,7 @@ impl + ?Sized> fmt::Debug for Padding { //--- Extended OptBuilder -impl<'a, Target: Composer> OptBuilder<'a, Target> { +impl OptBuilder<'_, Target> { pub fn padding( &mut self, len: u16) -> Result<(), Target::AppendError> { self.push_raw_option( OptionCode::PADDING, diff --git a/src/base/opt/subnet.rs b/src/base/opt/subnet.rs index 47f3c5521..03e06e207 100644 --- a/src/base/opt/subnet.rs +++ b/src/base/opt/subnet.rs @@ -275,7 +275,7 @@ impl Opt { } } -impl<'a, Target: Composer> OptBuilder<'a, Target> { +impl OptBuilder<'_, Target> { pub fn client_subnet( &mut self, source_prefix_len: u8, diff --git a/src/base/question.rs b/src/base/question.rs index 92b8f370e..97fbdddfc 100644 --- a/src/base/question.rs +++ b/src/base/question.rs @@ -331,7 +331,7 @@ pub trait ComposeQuestion { ) -> Result<(), Target::AppendError>; } -impl<'a, Q: ComposeQuestion> ComposeQuestion for &'a Q { +impl ComposeQuestion for &Q { fn compose_question( &self, target: &mut Target, diff --git a/src/base/rdata.rs b/src/base/rdata.rs index d33390113..337c9838e 100644 --- a/src/base/rdata.rs +++ b/src/base/rdata.rs @@ -40,7 +40,7 @@ pub trait RecordData { fn rtype(&self) -> Rtype; } -impl<'a, T: RecordData> RecordData for &'a T { +impl RecordData for &T { fn rtype(&self) -> Rtype { (*self).rtype() } @@ -126,7 +126,7 @@ where } } -impl<'a, T: ComposeRecordData> ComposeRecordData for &'a T { +impl ComposeRecordData for &T { fn rdlen(&self, compress: bool) -> Option { (*self).rdlen(compress) } diff --git a/src/base/record.rs b/src/base/record.rs index 553e2e2e6..dd82b21e8 100644 --- a/src/base/record.rs +++ b/src/base/record.rs @@ -471,7 +471,7 @@ pub trait ComposeRecord { ) -> Result<(), Target::AppendError>; } -impl<'a, T: ComposeRecord> ComposeRecord for &'a T { +impl ComposeRecord for &T { fn compose_record( &self, target: &mut Target, @@ -1026,8 +1026,8 @@ impl<'a, Octs: Octets + ?Sized> ParsedRecord<'a, Octs> { //--- PartialEq and Eq -impl<'a, 'o, Octs, Other> PartialEq> - for ParsedRecord<'a, Octs> +impl<'o, Octs, Other> PartialEq> + for ParsedRecord<'_, Octs> where Octs: Octets + ?Sized, Other: Octets + ?Sized, @@ -1041,7 +1041,7 @@ where } } -impl<'a, Octs: Octets + ?Sized> Eq for ParsedRecord<'a, Octs> {} +impl Eq for ParsedRecord<'_, Octs> {} //------------ RecordParseError ---------------------------------------------- diff --git a/src/base/serde.rs b/src/base/serde.rs index 468ff0ab2..c68badaa5 100644 --- a/src/base/serde.rs +++ b/src/base/serde.rs @@ -32,7 +32,7 @@ where ) -> Result { struct Visitor(PhantomData); - impl<'de, T> serde::de::Visitor<'de> for Visitor + impl serde::de::Visitor<'_> for Visitor where T: From + FromStr, T::Err: fmt::Display, @@ -70,7 +70,7 @@ where ) -> Result { struct Visitor(PhantomData); - impl<'de, T> serde::de::Visitor<'de> for Visitor + impl serde::de::Visitor<'_> for Visitor where T: From + FromStr, T::Err: fmt::Display, @@ -108,7 +108,7 @@ where ) -> Result { struct Visitor(PhantomData); - impl<'de, T> serde::de::Visitor<'de> for Visitor + impl serde::de::Visitor<'_> for Visitor where T: From + FromStr, T::Err: fmt::Display, diff --git a/src/base/wire.rs b/src/base/wire.rs index a97ef3386..86c9908c8 100644 --- a/src/base/wire.rs +++ b/src/base/wire.rs @@ -85,7 +85,7 @@ pub trait Compose { ) -> Result<(), Target::AppendError>; } -impl<'a, T: Compose + ?Sized> Compose for &'a T { +impl Compose for &T { const COMPOSE_LEN: u16 = T::COMPOSE_LEN; fn compose( diff --git a/src/net/client/load_balancer.rs b/src/net/client/load_balancer.rs index 00671bfa6..8ba9bb58f 100644 --- a/src/net/client/load_balancer.rs +++ b/src/net/client/load_balancer.rs @@ -878,7 +878,7 @@ where receiver: mpsc::Receiver>, } -impl<'a, Req: Clone + Send + Sync + 'static> Transport { +impl Transport { /// Implementation of the new method. fn new(receiver: mpsc::Receiver>) -> Self { Self { receiver } diff --git a/src/net/client/redundant.rs b/src/net/client/redundant.rs index 4e1f1d51d..7ec167cdb 100644 --- a/src/net/client/redundant.rs +++ b/src/net/client/redundant.rs @@ -648,7 +648,7 @@ where receiver: mpsc::Receiver>, } -impl<'a, Req: Clone + Send + Sync + 'static> Transport { +impl Transport { /// Implementation of the new method. fn new(receiver: mpsc::Receiver>) -> Self { Self { receiver } diff --git a/src/net/client/request.rs b/src/net/client/request.rs index 8212a138e..534cb558a 100644 --- a/src/net/client/request.rs +++ b/src/net/client/request.rs @@ -78,9 +78,6 @@ pub trait ComposeRequestMulti: Debug + Send + Sync { /// Create a message that captures the recorded changes. fn to_message(&self) -> Result>, Error>; - /// Create a message that captures the recorded changes and convert to - /// a Vec. - /// Return a reference to the current Header. fn header(&self) -> &Header; diff --git a/src/net/server/dgram.rs b/src/net/server/dgram.rs index 253a43f7f..8fa7fe8e1 100644 --- a/src/net/server/dgram.rs +++ b/src/net/server/dgram.rs @@ -247,7 +247,6 @@ type CommandReceiver = watch::Receiver; /// [`VecBufSource`]: super::buf::VecBufSource /// [`tokio::net::TcpListener`]: /// https://docs.rs/tokio/latest/tokio/net/struct.TcpListener.html - pub struct DgramServer where Sock: AsyncDgramSock + Send + Sync + 'static, diff --git a/src/net/server/middleware/tsig.rs b/src/net/server/middleware/tsig.rs index 759328965..195fe3484 100644 --- a/src/net/server/middleware/tsig.rs +++ b/src/net/server/middleware/tsig.rs @@ -461,7 +461,6 @@ where } /// Data needed to do signing during response post-processing. - pub struct PostprocessingState { /// The signer used to verify the request. /// diff --git a/src/net/xfr/protocol/iterator.rs b/src/net/xfr/protocol/iterator.rs index ae17771b8..055e82e9a 100644 --- a/src/net/xfr/protocol/iterator.rs +++ b/src/net/xfr/protocol/iterator.rs @@ -60,7 +60,7 @@ impl<'a, 'b> XfrZoneUpdateIterator<'a, 'b> { } } -impl<'a, 'b> Iterator for XfrZoneUpdateIterator<'a, 'b> { +impl Iterator for XfrZoneUpdateIterator<'_, '_> { type Item = Result, IterationError>; fn next(&mut self) -> Option { diff --git a/src/rdata/dnssec.rs b/src/rdata/dnssec.rs index fdb79dd52..4f406c308 100644 --- a/src/rdata/dnssec.rs +++ b/src/rdata/dnssec.rs @@ -602,12 +602,12 @@ where /// DNS uses 32 bit timestamps that are conceptionally /// viewed as the 32 bit modulus of a larger number space. Because of that, /// special rules apply when processing these values. - +/// /// [RFC 4034] defines Timestamps as the number of seconds elepased since /// since 1 January 1970 00:00:00 UTC, ignoring leap seconds. Timestamps /// are compared using so-called "Serial number arithmetic", as defined in /// [RFC 1982]. - +/// /// The RFC defines the semantics for doing arithmetics in the /// face of these wrap-arounds. This type implements these semantics atop a /// native `u32`. The RFC defines two operations: addition and comparison. @@ -621,7 +621,6 @@ where /// pairs of values that are not equal but there still isn’t one value larger /// than the other. Since this is neatly implemented by the `PartialOrd` /// trait, the type implements that. - /// /// [RFC 1982]: https://tools.ietf.org/html/rfc1982 /// [RFC 4034]: https://tools.ietf.org/html/rfc4034 @@ -2305,7 +2304,7 @@ where if serializer.is_human_readable() { struct Inner<'a>(&'a [u8]); - impl<'a> serde::Serialize for Inner<'a> { + impl serde::Serialize for Inner<'_> { fn serialize( &self, serializer: S, @@ -2626,7 +2625,7 @@ impl<'a> RtypeBitmapIter<'a> { } } -impl<'a> Iterator for RtypeBitmapIter<'a> { +impl Iterator for RtypeBitmapIter<'_> { type Item = Rtype; fn next(&mut self) -> Option { diff --git a/src/rdata/rfc1035/txt.rs b/src/rdata/rfc1035/txt.rs index fb680d24a..3eb1d51d6 100644 --- a/src/rdata/rfc1035/txt.rs +++ b/src/rdata/rfc1035/txt.rs @@ -477,7 +477,7 @@ where struct TxtSeq<'a, Octs>(&'a Txt); - impl<'a, Octs> serde::Serialize for TxtSeq<'a, Octs> + impl serde::Serialize for TxtSeq<'_, Octs> where Octs: AsRef<[u8]> + SerializeOctets, { diff --git a/src/rdata/svcb/value.rs b/src/rdata/svcb/value.rs index 371c631c3..919928d66 100644 --- a/src/rdata/svcb/value.rs +++ b/src/rdata/svcb/value.rs @@ -474,7 +474,7 @@ impl> Mandatory { //--- Iterator -impl<'a, Octs: Octets + ?Sized> Iterator for MandatoryIter<'a, Octs> { +impl Iterator for MandatoryIter<'_, Octs> { type Item = SvcParamKey; fn next(&mut self) -> Option { @@ -1089,7 +1089,7 @@ impl> Ipv4Hint { } } -impl<'a, Octs: Octets + ?Sized> Iterator for Ipv4HintIter<'a, Octs> { +impl Iterator for Ipv4HintIter<'_, Octs> { type Item = Ipv4Addr; fn next(&mut self) -> Option { @@ -1234,7 +1234,7 @@ impl> Ipv6Hint { //--- Iterator -impl<'a, Octs: Octets + ?Sized> Iterator for Ipv6HintIter<'a, Octs> { +impl Iterator for Ipv6HintIter<'_, Octs> { type Item = Ipv6Addr; fn next(&mut self) -> Option { diff --git a/src/resolv/lookup/host.rs b/src/resolv/lookup/host.rs index cbf248971..ae860663d 100644 --- a/src/resolv/lookup/host.rs +++ b/src/resolv/lookup/host.rs @@ -185,7 +185,7 @@ pub struct FoundHostsIter<'a> { a: Option>, } -impl<'a> Iterator for FoundHostsIter<'a> { +impl Iterator for FoundHostsIter<'_> { type Item = IpAddr; fn next(&mut self) -> Option { @@ -216,7 +216,7 @@ pub struct FoundHostsSocketIter<'a> { port: u16, } -impl<'a> Iterator for FoundHostsSocketIter<'a> { +impl Iterator for FoundHostsSocketIter<'_> { type Item = SocketAddr; fn next(&mut self) -> Option { @@ -226,7 +226,7 @@ impl<'a> Iterator for FoundHostsSocketIter<'a> { } } -impl<'a> ToSocketAddrs for FoundHostsSocketIter<'a> { +impl ToSocketAddrs for FoundHostsSocketIter<'_> { type Iter = Self; fn to_socket_addrs(&self) -> io::Result { diff --git a/src/resolv/stub/conf.rs b/src/resolv/stub/conf.rs index 8a06ce116..092064e1a 100644 --- a/src/resolv/stub/conf.rs +++ b/src/resolv/stub/conf.rs @@ -34,9 +34,8 @@ pub struct ResolvOptions { /// Search list for host-name lookup. pub search: SearchList, - /// TODO Sortlist - /// sortlist: ?? - + // TODO Sortlist + // sortlist: ?? /// Number of dots before an initial absolute query is made. pub ndots: usize, diff --git a/src/resolv/stub/mod.rs b/src/resolv/stub/mod.rs index af4c6fed6..a1f46aabb 100644 --- a/src/resolv/stub/mod.rs +++ b/src/resolv/stub/mod.rs @@ -511,7 +511,7 @@ pub struct SearchIter<'a> { pos: usize, } -impl<'a> Iterator for SearchIter<'a> { +impl Iterator for SearchIter<'_> { type Item = SearchSuffix; fn next(&mut self) -> Option { diff --git a/src/stelline/client.rs b/src/stelline/client.rs index 79fad00ac..63e194b93 100644 --- a/src/stelline/client.rs +++ b/src/stelline/client.rs @@ -41,7 +41,7 @@ pub struct StellineError<'a> { cause: StellineErrorCause, } -impl<'a> std::fmt::Display for StellineError<'a> { +impl std::fmt::Display for StellineError<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_fmt(format_args!( "Stelline test failed at step {} with error: {}", @@ -836,13 +836,13 @@ struct RawOptData<'a> { bytes: &'a [u8], } -impl<'a> OptData for RawOptData<'a> { +impl OptData for RawOptData<'_> { fn code(&self) -> OptionCode { u16::from_be_bytes(self.bytes[0..2].try_into().unwrap()).into() } } -impl<'a> ComposeOptData for RawOptData<'a> { +impl ComposeOptData for RawOptData<'_> { fn compose_len(&self) -> u16 { u16::from_be_bytes(self.bytes[2..4].try_into().unwrap()) } diff --git a/src/utils/base16.rs b/src/utils/base16.rs index 13e5d7b6a..4b1b08a78 100644 --- a/src/utils/base16.rs +++ b/src/utils/base16.rs @@ -88,7 +88,7 @@ pub fn encode_display + ?Sized>( ) -> impl fmt::Display + '_ { struct Display<'a>(&'a [u8]); - impl<'a> fmt::Display for Display<'a> { + impl fmt::Display for Display<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { display(self.0, f) } diff --git a/src/utils/base32.rs b/src/utils/base32.rs index b88b5a4b4..33372bea8 100644 --- a/src/utils/base32.rs +++ b/src/utils/base32.rs @@ -118,7 +118,7 @@ pub fn encode_display_hex>( ) -> impl fmt::Display + '_ { struct Display<'a>(&'a [u8]); - impl<'a> fmt::Display for Display<'a> { + impl fmt::Display for Display<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { display_hex(self.0, f) } diff --git a/src/utils/base64.rs b/src/utils/base64.rs index b2473a66d..062b2c4eb 100644 --- a/src/utils/base64.rs +++ b/src/utils/base64.rs @@ -104,7 +104,7 @@ pub fn encode_display>( ) -> impl fmt::Display + '_ { struct Display<'a>(&'a [u8]); - impl<'a> fmt::Display for Display<'a> { + impl fmt::Display for Display<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { display(self.0, f) } diff --git a/src/validate.rs b/src/validate.rs index 64d6a1a28..8e0e1f9f9 100644 --- a/src/validate.rs +++ b/src/validate.rs @@ -328,7 +328,7 @@ impl> Key { /// See the type-level documentation for a description of this format. pub fn display_as_bind(&self) -> impl fmt::Display + '_ { struct Display<'a, Octs>(&'a Key); - impl<'a, Octs: AsRef<[u8]>> fmt::Display for Display<'a, Octs> { + impl> fmt::Display for Display<'_, Octs> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.format_as_bind(f) } diff --git a/src/validator/group.rs b/src/validator/group.rs index edb2952f7..85b9e2407 100644 --- a/src/validator/group.rs +++ b/src/validator/group.rs @@ -266,7 +266,7 @@ impl Group { // This may fail if sig_set is empty. But either rr_set or // sig_set is not empty. - return self.sig_set[0].owner().to_bytes(); + self.sig_set[0].owner().to_bytes() } /// Return the class of a group. @@ -943,7 +943,7 @@ impl ValidatedGroup { // This may fail if sig_set is empty. But either rr_set or // sig_set is not empty. - return self.sig_set[0].owner().to_bytes(); + self.sig_set[0].owner().to_bytes() } /// Return the DNSSEC validation state of the group. diff --git a/src/zonefile/inplace.rs b/src/zonefile/inplace.rs index ba679bfd7..af4b0c113 100644 --- a/src/zonefile/inplace.rs +++ b/src/zonefile/inplace.rs @@ -477,7 +477,7 @@ impl<'a> EntryScanner<'a> { } } -impl<'a> Scanner for EntryScanner<'a> { +impl Scanner for EntryScanner<'_> { type Octets = Bytes; type OctetsBuilder = BytesMut; type Name = ScannedDname; @@ -764,7 +764,7 @@ impl<'a> Scanner for EntryScanner<'a> { } } -impl<'a> EntryScanner<'a> { +impl EntryScanner<'_> { /// Converts a single token using a token converter. fn convert_one_token< S: From, diff --git a/src/zonetree/traits.rs b/src/zonetree/traits.rs index e2fc12ef1..8bb9cc4a9 100644 --- a/src/zonetree/traits.rs +++ b/src/zonetree/traits.rs @@ -337,11 +337,13 @@ pub trait ZoneDiff { //--- impl ZoneDiff for Arc impl ZoneDiff for Arc { - type Item<'a> = T::Item<'a> + type Item<'a> + = T::Item<'a> where Self: 'a; - type Stream<'a> = T::Stream<'a> + type Stream<'a> + = T::Stream<'a> where Self: 'a; diff --git a/src/zonetree/types.rs b/src/zonetree/types.rs index 777ab5eb0..7600a73aa 100644 --- a/src/zonetree/types.rs +++ b/src/zonetree/types.rs @@ -408,11 +408,15 @@ impl<'a> ZoneDiffItem for (&'a (StoredName, Rtype), &'a SharedRrset) { } impl ZoneDiff for InMemoryZoneDiff { - type Item<'a> = (&'a (StoredName, Rtype), &'a SharedRrset) + type Item<'a> + = (&'a (StoredName, Rtype), &'a SharedRrset) where Self: 'a; - type Stream<'a> = futures_util::stream::Iter> + type Stream<'a> + = futures_util::stream::Iter< + hash_map::Iter<'a, (StoredName, Rtype), SharedRrset>, + > where Self: 'a; @@ -489,11 +493,13 @@ impl futures_util::stream::Stream for EmptyZoneDiffStream { pub struct EmptyZoneDiff; impl ZoneDiff for EmptyZoneDiff { - type Item<'a> = EmptyZoneDiffItem + type Item<'a> + = EmptyZoneDiffItem where Self: 'a; - type Stream<'a> = EmptyZoneDiffStream + type Stream<'a> + = EmptyZoneDiffStream where Self: 'a;