Skip to content

Commit ed121c9

Browse files
committed
Clippy: remove needless lifetimes
1 parent bc4b761 commit ed121c9

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

src/bgp/aspath.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ impl<'a, Octs> Asns<'a, Octs> {
12371237
}
12381238
}
12391239

1240-
impl<'a, Octs: Octets> Iterator for Asns<'a, Octs> {
1240+
impl<Octs: Octets> Iterator for Asns<'_, Octs> {
12411241
type Item = Asn;
12421242
// NB: if the underlying octets are not a multiple of four (or two, in
12431243
// case of legacy ASNs), the iterator will yield None for that last

src/bgp/message/update_builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ pub struct PduIterator<'a, Target, A> {
683683
session_config: &'a SessionConfig,
684684
}
685685

686-
impl<'a, Target, A> Iterator for PduIterator<'a, Target, A>
686+
impl<Target, A> Iterator for PduIterator<'_, Target, A>
687687
where
688688
A: AfiSafiNlri + NlriCompose + Clone,
689689
Target: Clone + OctetsBuilder + FreezeBuilder + AsMut<[u8]> + octseq::Truncate,

src/bgp/nlri/mpls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ pub struct LabelsIterator<'a, Octs> {
267267
/// Iterate over MPLS labels as they occur in BGP NLRI.
268268
///
269269
/// These are the 3 byte, no-TTL style labels.
270-
impl<'a, O: AsRef<[u8]>> Iterator for LabelsIterator<'a, O> {
270+
impl<O: AsRef<[u8]>> Iterator for LabelsIterator<'_, O> {
271271
type Item = Label;
272272

273273
fn next(&mut self) -> Option<Self::Item> {

src/bgp/path_attributes.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ pub struct UnimplementedWireformat<'a, Octs: Octets> {
859859
value: Parser<'a, Octs>,
860860
}
861861

862-
impl<'a, Octs: Octets> fmt::Debug for UnimplementedWireformat<'a, Octs> {
862+
impl<Octs: Octets> fmt::Debug for UnimplementedWireformat<'_, Octs> {
863863
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
864864
write!(f, "{:08b} {} {:02x?}",
865865
u8::from(self.flags()), self.type_code(), self.value()
@@ -965,13 +965,13 @@ pub struct PathAttributes<'a, Octs> {
965965
pub pdu_parse_info: PduParseInfo,
966966
}
967967

968-
impl<'a, Octs> Clone for PathAttributes<'a, Octs> {
968+
impl<Octs> Clone for PathAttributes<'_, Octs> {
969969
fn clone(&self) -> Self {
970970
*self
971971
}
972972
}
973973

974-
impl<'a, Octs> Copy for PathAttributes<'a, Octs> { }
974+
impl<Octs> Copy for PathAttributes<'_, Octs> { }
975975

976976
impl<'a, Octs: Octets> PathAttributes<'a, Octs> {
977977
pub fn new(parser: Parser<'_, Octs>, pdu_parse_info: PduParseInfo)

src/bgp/path_selection.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct OrdRoute<'a, OS> {
2525
_strategy: std::marker::PhantomData<OS>,
2626
}
2727

28-
impl<'a, OS> OrdRoute<'a, OS> {
28+
impl<OS> OrdRoute<'_, OS> {
2929
/// Check if all required path attributes are present and valid.
3030
///
3131
/// This checks that:
@@ -201,7 +201,7 @@ impl OrdStrat for SkipMed {
201201
}
202202
}
203203

204-
impl<'a, OS: OrdStrat> PartialOrd for OrdRoute<'a, OS> {
204+
impl<OS: OrdStrat> PartialOrd for OrdRoute<'_, OS> {
205205
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
206206
Some(self.cmp(other))
207207
}
@@ -216,7 +216,7 @@ impl<'a, OS: OrdStrat> PartialOrd for OrdRoute<'a, OS> {
216216
/// **NB**: for a route to be an actual candidate in the path selection
217217
/// process, additional checks need to be performed beforehand. Refer to
218218
/// [`eligible`] for the specific checks.
219-
impl<'a, OS: OrdStrat> Ord for OrdRoute<'a, OS> {
219+
impl<OS: OrdStrat> Ord for OrdRoute<'_, OS> {
220220
fn cmp(&self, other: &Self) -> cmp::Ordering {
221221
// Degree of preference
222222
// The DoP is taken from LOCAL_PREF in case of IBGP, or when that's
@@ -387,9 +387,9 @@ impl<'a, OS: OrdStrat> Ord for OrdRoute<'a, OS> {
387387
}
388388
}
389389

390-
impl<'a, OS: OrdStrat> Eq for OrdRoute<'a, OS> {}
390+
impl<OS: OrdStrat> Eq for OrdRoute<'_, OS> {}
391391

392-
impl<'a, OS: OrdStrat> PartialEq for OrdRoute<'a, OS> {
392+
impl<OS: OrdStrat> PartialEq for OrdRoute<'_, OS> {
393393
fn eq(&self, other: &Self) -> bool {
394394
self.cmp(other).is_eq()
395395
}

src/bgpsec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl<'de> serde::Deserialize<'de> for KeyIdentifier {
124124
) -> Result<Self, D::Error> {
125125
struct KeyIdentifierVisitor;
126126

127-
impl<'de> serde::de::Visitor<'de> for KeyIdentifierVisitor {
127+
impl serde::de::Visitor<'_> for KeyIdentifierVisitor {
128128
type Value = KeyIdentifier;
129129

130130
fn expecting(

src/bmp/message.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl<Octets: AsRef<[u8]>> AsRef<[u8]> for RouteMirroring<Octets> {
137137

138138
//--- Parsing and impl of the Message enum wrapper ---------------------------
139139

140-
impl<'a, Octs: Octets + 'a> Message<Octs> {
140+
impl<Octs: Octets> Message<Octs> {
141141
pub fn from_octets(octets: Octs) -> Result<Self, ParseError> {
142142
let msg_type = {
143143
let mut parser = Parser::from_ref(&octets);
@@ -1180,7 +1180,7 @@ impl<'a> InformationTlv<'a> {
11801180
}
11811181
}
11821182

1183-
impl<'a> Display for InformationTlv<'a> {
1183+
impl Display for InformationTlv<'_> {
11841184
fn fmt(&self, f: &mut Formatter) -> FmtResult {
11851185
match self.typ() {
11861186
InformationTlvType::String
@@ -1406,7 +1406,7 @@ impl <'a>StatIter<'a> {
14061406
}
14071407
}
14081408
}
1409-
impl <'a>Iterator for StatIter<'a> {
1409+
impl Iterator for StatIter<'_> {
14101410
type Item = Stat;
14111411
fn next(&mut self) -> Option<Self::Item> {
14121412
if self.left > 0 {

src/mrt.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -533,13 +533,13 @@ pub enum Bgp4Mp<'a, Octs> {
533533
//MessageAs4Local(MessageAs4Local),
534534
}
535535

536-
impl<'a, Octs> From<StateChange> for Bgp4Mp<'a, Octs> {
536+
impl<Octs> From<StateChange> for Bgp4Mp<'_, Octs> {
537537
fn from(msg: StateChange) -> Self {
538538
Self::StateChange(msg)
539539
}
540540
}
541541

542-
impl<'a, Octs> From<StateChangeAs4> for Bgp4Mp<'a, Octs> {
542+
impl<Octs> From<StateChangeAs4> for Bgp4Mp<'_, Octs> {
543543
fn from(msg: StateChangeAs4) -> Self {
544544
Self::StateChangeAs4(msg)
545545
}

0 commit comments

Comments
 (0)