Skip to content

Commit

Permalink
fix new rust lints (#1467)
Browse files Browse the repository at this point in the history
# Description

@swift-nav/algint-team -- maybe fixes new rust lints

<!-- Changes proposed in this PR -->

# API compatibility

Does this change introduce a API compatibility risk?

<!-- Provide a short explanation why or why not -->

## API compatibility plan

If the above is "Yes", please detail the compatibility (or migration)
plan:

<!-- Provide a short explanation plan here -->

# JIRA Reference

https://swift-nav.atlassian.net/browse/BOARD-XXXX
  • Loading branch information
pcrumley authored Dec 11, 2024
1 parent 59d2677 commit 1eef842
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ use crate::messages::(((i)))::*;
((*- endfor *))

((*- if m.desc *))

/// (((m.short_desc)))
((* if m.short_desc *))
/// (((m.short_desc | commentify)))
((*- endif *))
///
/// (((m.desc | commentify)))
///
Expand Down
6 changes: 3 additions & 3 deletions rust/sbp/src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ where
}
}

impl<'link> LinkSource<'link, ()> {
impl LinkSource<'_, ()> {
/// Send a message to all the links associated with this source.
pub fn send<M>(&self, msg: M) -> bool
where
Expand Down Expand Up @@ -129,7 +129,7 @@ impl<'link, S> Link<'link, S> {
}
}

impl<'link, S> Clone for Link<'link, S> {
impl<S> Clone for Link<'_, S> {
fn clone(&self) -> Self {
Self {
inner: Arc::clone(&self.inner),
Expand All @@ -148,7 +148,7 @@ pub struct Handler<'link, S> {
msg_types: Cow<'static, [u16]>,
}

impl<'link, S> Handler<'link, S> {
impl<S> Handler<'_, S> {
fn run(&mut self, state: &S, msg: Sbp) {
(self.func)(state, msg);
}
Expand Down
1 change: 0 additions & 1 deletion rust/sbp/src/messages/file_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ pub mod msg_fileio_config_resp {
use crate::messages::lib::*;

/// Response with advice on the optimal configuration for FileIO.
///
/// The advice on the optimal configuration for a FileIO transfer. Newer
/// version of FileIO can support greater throughput by supporting a large
Expand Down
2 changes: 0 additions & 2 deletions rust/sbp/src/messages/flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,6 @@ pub mod msg_stm_unique_id_req {
use crate::messages::lib::*;

/// Read device's hard-coded unique ID request (host => device)
///
/// This message reads the device's hard-coded unique ID. The host requests
/// the ID by sending a MSG_STM_UNIQUE_ID_REQ. The device responds with a
Expand Down Expand Up @@ -1112,7 +1111,6 @@ pub mod msg_stm_unique_id_resp {
use crate::messages::lib::*;

/// Read device's hard-coded unique ID response (host <= device)
///
/// This message reads the device's hard-coded unique ID. The host requests
/// the ID by sending a MSG_STM_UNIQUE_ID_REQ. The device responds with a
Expand Down
1 change: 0 additions & 1 deletion rust/sbp/src/messages/navigation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6984,7 +6984,6 @@ pub mod msg_utc_leap_second {
use crate::messages::lib::*;

/// Leap second SBP message.
///
/// UTC-GPST leap seconds before and after the most recent (past, or future,
/// for announced insertions) UTC leap second insertion.
Expand Down
8 changes: 4 additions & 4 deletions rust/sbp/src/messages/solution_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ pub mod imu_input_type {
use super::*;
use crate::messages::lib::*;

/// Provides detail about the IMU sensor, its timestamping mode, and its quality for input to the fuzed solution
/// Provides detail about the IMU sensor, its timestamping mode, and its
/// quality for input to the fuzed solution
///
/// Metadata around the IMU sensors involved in the fuzed solution. Accessible
/// through sol_in\[N\].flags in a MSG_SOLN_META.
Expand Down Expand Up @@ -755,8 +755,8 @@ pub mod odo_input_type {
use super::*;
use crate::messages::lib::*;

/// Provides detail about the Odometry sensor, its timestamping mode, and its quality for input to the fuzed solution
/// Provides detail about the Odometry sensor, its timestamping mode, and its
/// quality for input to the fuzed solution
///
/// Metadata around the Odometry sensors involved in the fuzed solution.
/// Accessible through sol_in\[N\].flags in a MSG_SOLN_META.
Expand Down
9 changes: 0 additions & 9 deletions rust/sbp/src/messages/ssr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2671,7 +2671,6 @@ pub mod msg_ssr_tile_definition {
use crate::messages::lib::*;

/// Definition of a SSR atmospheric correction tile.
///
/// Provides the correction point coordinates for the atmospheric correction
/// values in the MSG_SSR_STEC_CORRECTION and MSG_SSR_GRIDDED_CORRECTION
Expand Down Expand Up @@ -3242,7 +3241,6 @@ pub mod orbit_clock_bound {
use crate::messages::gnss::*;
use crate::messages::lib::*;

/// None
///
/// Orbit and clock bound.
///
Expand Down Expand Up @@ -3335,7 +3333,6 @@ pub mod orbit_clock_bound_degradation {
use crate::messages::gnss::*;
use crate::messages::lib::*;

/// None
///
/// Orbit and clock bound degradation.
///
Expand Down Expand Up @@ -3637,7 +3634,6 @@ pub mod stec_residual {
use crate::messages::gnss::*;
use crate::messages::lib::*;

/// None
///
/// STEC residual (mean and standard deviation) for the given satellite at the
/// grid point.
Expand Down Expand Up @@ -3689,7 +3685,6 @@ pub mod stec_residual_no_std {
use crate::messages::gnss::*;
use crate::messages::lib::*;

/// None
///
/// STEC residual for the given satellite at the grid point.
///
Expand Down Expand Up @@ -3730,7 +3725,6 @@ pub mod stec_sat_element {
use crate::messages::gnss::*;
use crate::messages::lib::*;

/// None
///
/// STEC polynomial for the given satellite.
///
Expand Down Expand Up @@ -3782,7 +3776,6 @@ pub mod stec_sat_element_integrity {
use crate::messages::gnss::*;
use crate::messages::lib::*;

/// None
///
/// STEC polynomial and bounds for the given satellite.
///
Expand Down Expand Up @@ -4075,7 +4068,6 @@ pub mod tropospheric_delay_correction {
use crate::messages::gnss::*;
use crate::messages::lib::*;

/// None
///
/// Troposphere vertical delays (mean and standard deviation) at the grid
/// point.
Expand Down Expand Up @@ -4127,7 +4119,6 @@ pub mod tropospheric_delay_correction_no_std {
use crate::messages::gnss::*;
use crate::messages::lib::*;

/// None
///
/// Troposphere vertical delays at the grid point.
///
Expand Down
2 changes: 1 addition & 1 deletion rust/sbp/src/sbp_iter_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ where
}
}

impl<'a, I, E> Iterator for HandleErrorsIter<'a, I, E>
impl<I, E> Iterator for HandleErrorsIter<'_, I, E>
where
I: Iterator<Item = Result<Sbp, E>>,
{
Expand Down
4 changes: 2 additions & 2 deletions rust/sbp/src/sbp_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl<'de, E> serde::Deserialize<'de> for SbpString<Vec<u8>, E> {
{
struct SbpStringVisitor<E>(PhantomData<SbpString<Vec<u8>, E>>);

impl<'de, E> Visitor<'de> for SbpStringVisitor<E> {
impl<E> Visitor<'_> for SbpStringVisitor<E> {
type Value = SbpString<Vec<u8>, E>;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -214,7 +214,7 @@ impl<'de, E, const LEN: usize> serde::Deserialize<'de> for SbpString<[u8; LEN],

struct SbpStringVisitor<E, const LEN: usize>(PhantomData<SbpString<[u8; LEN], E>>);

impl<'de, E, const LEN: usize> Visitor<'de> for SbpStringVisitor<E, LEN> {
impl<E, const LEN: usize> Visitor<'_> for SbpStringVisitor<E, LEN> {
type Value = SbpString<[u8; LEN], E>;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down

0 comments on commit 1eef842

Please sign in to comment.