Skip to content

Commit

Permalink
Clippy fixes for new rust release.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidv1992 authored and rnijveld committed Dec 5, 2024
1 parent b697179 commit 6d63aba
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
6 changes: 3 additions & 3 deletions statime/src/datastructures/common/tlv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub(crate) struct TlvSet<'a> {
bytes: &'a [u8],
}

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

impl<'a> TlvSetIterator<'a> {
impl TlvSetIterator<'_> {
pub(crate) fn empty() -> Self {
Self { buffer: &[] }
}
Expand All @@ -126,7 +126,7 @@ impl<'a> Iterator for TlvSetIterator<'a> {
}
}

impl<'a> FusedIterator for TlvSetIterator<'a> {}
impl FusedIterator for TlvSetIterator<'_> {}

#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct Tlv<'a> {
Expand Down
2 changes: 1 addition & 1 deletion statime/src/port/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct ForwardedTLV<'a> {
pub(super) sender_identity: PortIdentity,
}

impl<'a> ForwardedTLV<'a> {
impl ForwardedTLV<'_> {
/// Wire size of the TLV. Can be used to determine how many TLV's to keep
pub fn size(&self) -> usize {
self.tlv.wire_size()
Expand Down
10 changes: 5 additions & 5 deletions statime/src/port/bmca.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use crate::{
Clock,
};

impl<'a, A: AcceptableMasterList, C: Clock, F: Filter, R: Rng, S: PtpInstanceStateMutex>
Port<'a, Running, A, R, C, F, S>
impl<A: AcceptableMasterList, C: Clock, F: Filter, R: Rng, S: PtpInstanceStateMutex>
Port<'_, Running, A, R, C, F, S>
{
pub(super) fn handle_announce<'b>(
&'b mut self,
Expand Down Expand Up @@ -105,15 +105,15 @@ impl<'a, A: AcceptableMasterList, C: Clock, F: Filter, R: Rng, S: PtpInstanceSta
}

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

impl<'a, A, C: Clock, F: Filter, R: Rng, S: PtpInstanceStateMutex> Port<'a, InBmca, A, R, C, F, S> {
impl<A, C: Clock, F: Filter, R: Rng, S: PtpInstanceStateMutex> Port<'_, InBmca, A, R, C, F, S> {
pub(crate) fn step_announce_age(&mut self, step: Duration) {
if let Some(mut age) = self.multiport_disable.take() {
age += step;
Expand Down
2 changes: 1 addition & 1 deletion statime/src/port/master.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
time::Time,
};

impl<'a, A, C, F: Filter, R, S: PtpInstanceStateMutex> Port<'a, Running, A, R, C, F, S> {
impl<A, C, F: Filter, R, S: PtpInstanceStateMutex> Port<'_, Running, A, R, C, F, S> {
pub(super) fn send_sync(&mut self) -> PortActionIterator {
if matches!(self.port_state, PortState::Master) {
log::trace!("sending sync message");
Expand Down
6 changes: 2 additions & 4 deletions statime/src/port/slave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{
Clock,
};

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

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

0 comments on commit 6d63aba

Please sign in to comment.