Skip to content

Commit 6d63aba

Browse files
davidv1992rnijveld
authored andcommitted
Clippy fixes for new rust release.
1 parent b697179 commit 6d63aba

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

statime/src/datastructures/common/tlv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub(crate) struct TlvSet<'a> {
3131
bytes: &'a [u8],
3232
}
3333

34-
impl<'a> core::fmt::Debug for TlvSet<'a> {
34+
impl core::fmt::Debug for TlvSet<'_> {
3535
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3636
f.debug_struct("TlvSet")
3737
.field("wire_size", &self.wire_size())
@@ -102,7 +102,7 @@ pub(crate) struct TlvSetIterator<'a> {
102102
buffer: &'a [u8],
103103
}
104104

105-
impl<'a> TlvSetIterator<'a> {
105+
impl TlvSetIterator<'_> {
106106
pub(crate) fn empty() -> Self {
107107
Self { buffer: &[] }
108108
}
@@ -126,7 +126,7 @@ impl<'a> Iterator for TlvSetIterator<'a> {
126126
}
127127
}
128128

129-
impl<'a> FusedIterator for TlvSetIterator<'a> {}
129+
impl FusedIterator for TlvSetIterator<'_> {}
130130

131131
#[derive(Debug, Clone, PartialEq, Eq)]
132132
pub(crate) struct Tlv<'a> {

statime/src/port/actions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub struct ForwardedTLV<'a> {
1414
pub(super) sender_identity: PortIdentity,
1515
}
1616

17-
impl<'a> ForwardedTLV<'a> {
17+
impl ForwardedTLV<'_> {
1818
/// Wire size of the TLV. Can be used to determine how many TLV's to keep
1919
pub fn size(&self) -> usize {
2020
self.tlv.wire_size()

statime/src/port/bmca.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use crate::{
1919
Clock,
2020
};
2121

22-
impl<'a, A: AcceptableMasterList, C: Clock, F: Filter, R: Rng, S: PtpInstanceStateMutex>
23-
Port<'a, Running, A, R, C, F, S>
22+
impl<A: AcceptableMasterList, C: Clock, F: Filter, R: Rng, S: PtpInstanceStateMutex>
23+
Port<'_, Running, A, R, C, F, S>
2424
{
2525
pub(super) fn handle_announce<'b>(
2626
&'b mut self,
@@ -105,15 +105,15 @@ impl<'a, A: AcceptableMasterList, C: Clock, F: Filter, R: Rng, S: PtpInstanceSta
105105
}
106106

107107
// BMCA related functionality of the port
108-
impl<'a, A: AcceptableMasterList, C: Clock, F: Filter, R: Rng, S: PtpInstanceStateMutex>
109-
Port<'a, InBmca, A, R, C, F, S>
108+
impl<A: AcceptableMasterList, C: Clock, F: Filter, R: Rng, S: PtpInstanceStateMutex>
109+
Port<'_, InBmca, A, R, C, F, S>
110110
{
111111
pub(crate) fn calculate_best_local_announce_message(&mut self) {
112112
self.lifecycle.local_best = self.bmca.take_best_port_announce_message()
113113
}
114114
}
115115

116-
impl<'a, A, C: Clock, F: Filter, R: Rng, S: PtpInstanceStateMutex> Port<'a, InBmca, A, R, C, F, S> {
116+
impl<A, C: Clock, F: Filter, R: Rng, S: PtpInstanceStateMutex> Port<'_, InBmca, A, R, C, F, S> {
117117
pub(crate) fn step_announce_age(&mut self, step: Duration) {
118118
if let Some(mut age) = self.multiport_disable.take() {
119119
age += step;

statime/src/port/master.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{
1212
time::Time,
1313
};
1414

15-
impl<'a, A, C, F: Filter, R, S: PtpInstanceStateMutex> Port<'a, Running, A, R, C, F, S> {
15+
impl<A, C, F: Filter, R, S: PtpInstanceStateMutex> Port<'_, Running, A, R, C, F, S> {
1616
pub(super) fn send_sync(&mut self) -> PortActionIterator {
1717
if matches!(self.port_state, PortState::Master) {
1818
log::trace!("sending sync message");

statime/src/port/slave.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::{
1717
Clock,
1818
};
1919

20-
impl<'a, A, C: Clock, F: Filter, R, S> Port<'a, Running, A, R, C, F, S> {
20+
impl<A, C: Clock, F: Filter, R, S> Port<'_, Running, A, R, C, F, S> {
2121
pub(super) fn handle_time_measurement<'b>(&mut self) -> PortActionIterator<'b> {
2222
if let Some(measurement) = self.extract_measurement() {
2323
// If the received message allowed the (slave) state to calculate its offset
@@ -456,9 +456,7 @@ impl<'a, A, C: Clock, F: Filter, R, S> Port<'a, Running, A, R, C, F, S> {
456456
}
457457
}
458458

459-
impl<'a, A, C: Clock, F: Filter, R: Rng, S: PtpInstanceStateMutex>
460-
Port<'a, Running, A, R, C, F, S>
461-
{
459+
impl<A, C: Clock, F: Filter, R: Rng, S: PtpInstanceStateMutex> Port<'_, Running, A, R, C, F, S> {
462460
pub(super) fn send_delay_request(&mut self) -> PortActionIterator {
463461
match self.config.delay_mechanism {
464462
DelayMechanism::E2E { interval } => self.send_e2e_delay_request(interval),

0 commit comments

Comments
 (0)