Skip to content

Commit 1eef842

Browse files
authored
fix new rust lints (#1467)
# 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
1 parent 59d2677 commit 1eef842

File tree

9 files changed

+13
-25
lines changed

9 files changed

+13
-25
lines changed

generator/sbpg/targets/resources/rust/sbp_messages_template.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ use crate::messages::(((i)))::*;
3333
((*- endfor *))
3434

3535
((*- if m.desc *))
36-
37-
/// (((m.short_desc)))
36+
((* if m.short_desc *))
37+
/// (((m.short_desc | commentify)))
38+
((*- endif *))
3839
///
3940
/// (((m.desc | commentify)))
4041
///

rust/sbp/src/link.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ where
6868
}
6969
}
7070

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

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

151-
impl<'link, S> Handler<'link, S> {
151+
impl<S> Handler<'_, S> {
152152
fn run(&mut self, state: &S, msg: Sbp) {
153153
(self.func)(state, msg);
154154
}

rust/sbp/src/messages/file_io.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ pub mod msg_fileio_config_resp {
124124
use crate::messages::lib::*;
125125

126126
/// Response with advice on the optimal configuration for FileIO.
127-
128127
///
129128
/// The advice on the optimal configuration for a FileIO transfer. Newer
130129
/// version of FileIO can support greater throughput by supporting a large

rust/sbp/src/messages/flash.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,6 @@ pub mod msg_stm_unique_id_req {
10331033
use crate::messages::lib::*;
10341034

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

11141113
/// Read device's hard-coded unique ID response (host <= device)
1115-
11161114
///
11171115
/// This message reads the device's hard-coded unique ID. The host requests
11181116
/// the ID by sending a MSG_STM_UNIQUE_ID_REQ. The device responds with a

rust/sbp/src/messages/navigation.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6984,7 +6984,6 @@ pub mod msg_utc_leap_second {
69846984
use crate::messages::lib::*;
69856985

69866986
/// Leap second SBP message.
6987-
69886987
///
69896988
/// UTC-GPST leap seconds before and after the most recent (past, or future,
69906989
/// for announced insertions) UTC leap second insertion.

rust/sbp/src/messages/solution_meta.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ pub mod imu_input_type {
119119
use super::*;
120120
use crate::messages::lib::*;
121121

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

758-
/// Provides detail about the Odometry sensor, its timestamping mode, and its quality for input to the fuzed solution
759-
758+
/// Provides detail about the Odometry sensor, its timestamping mode, and its
759+
/// quality for input to the fuzed solution
760760
///
761761
/// Metadata around the Odometry sensors involved in the fuzed solution.
762762
/// Accessible through sol_in\[N\].flags in a MSG_SOLN_META.

rust/sbp/src/messages/ssr.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,7 +2671,6 @@ pub mod msg_ssr_tile_definition {
26712671
use crate::messages::lib::*;
26722672

26732673
/// Definition of a SSR atmospheric correction tile.
2674-
26752674
///
26762675
/// Provides the correction point coordinates for the atmospheric correction
26772676
/// values in the MSG_SSR_STEC_CORRECTION and MSG_SSR_GRIDDED_CORRECTION
@@ -3242,7 +3241,6 @@ pub mod orbit_clock_bound {
32423241
use crate::messages::gnss::*;
32433242
use crate::messages::lib::*;
32443243

3245-
/// None
32463244
///
32473245
/// Orbit and clock bound.
32483246
///
@@ -3335,7 +3333,6 @@ pub mod orbit_clock_bound_degradation {
33353333
use crate::messages::gnss::*;
33363334
use crate::messages::lib::*;
33373335

3338-
/// None
33393336
///
33403337
/// Orbit and clock bound degradation.
33413338
///
@@ -3637,7 +3634,6 @@ pub mod stec_residual {
36373634
use crate::messages::gnss::*;
36383635
use crate::messages::lib::*;
36393636

3640-
/// None
36413637
///
36423638
/// STEC residual (mean and standard deviation) for the given satellite at the
36433639
/// grid point.
@@ -3689,7 +3685,6 @@ pub mod stec_residual_no_std {
36893685
use crate::messages::gnss::*;
36903686
use crate::messages::lib::*;
36913687

3692-
/// None
36933688
///
36943689
/// STEC residual for the given satellite at the grid point.
36953690
///
@@ -3730,7 +3725,6 @@ pub mod stec_sat_element {
37303725
use crate::messages::gnss::*;
37313726
use crate::messages::lib::*;
37323727

3733-
/// None
37343728
///
37353729
/// STEC polynomial for the given satellite.
37363730
///
@@ -3782,7 +3776,6 @@ pub mod stec_sat_element_integrity {
37823776
use crate::messages::gnss::*;
37833777
use crate::messages::lib::*;
37843778

3785-
/// None
37863779
///
37873780
/// STEC polynomial and bounds for the given satellite.
37883781
///
@@ -4075,7 +4068,6 @@ pub mod tropospheric_delay_correction {
40754068
use crate::messages::gnss::*;
40764069
use crate::messages::lib::*;
40774070

4078-
/// None
40794071
///
40804072
/// Troposphere vertical delays (mean and standard deviation) at the grid
40814073
/// point.
@@ -4127,7 +4119,6 @@ pub mod tropospheric_delay_correction_no_std {
41274119
use crate::messages::gnss::*;
41284120
use crate::messages::lib::*;
41294121

4130-
/// None
41314122
///
41324123
/// Troposphere vertical delays at the grid point.
41334124
///

rust/sbp/src/sbp_iter_ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ where
9494
}
9595
}
9696

97-
impl<'a, I, E> Iterator for HandleErrorsIter<'a, I, E>
97+
impl<I, E> Iterator for HandleErrorsIter<'_, I, E>
9898
where
9999
I: Iterator<Item = Result<Sbp, E>>,
100100
{

rust/sbp/src/sbp_string.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl<'de, E> serde::Deserialize<'de> for SbpString<Vec<u8>, E> {
165165
{
166166
struct SbpStringVisitor<E>(PhantomData<SbpString<Vec<u8>, E>>);
167167

168-
impl<'de, E> Visitor<'de> for SbpStringVisitor<E> {
168+
impl<E> Visitor<'_> for SbpStringVisitor<E> {
169169
type Value = SbpString<Vec<u8>, E>;
170170

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

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

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

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

0 commit comments

Comments
 (0)