From 35073a45a536051e3852696c501d7afa1b36a808 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 16 Aug 2022 11:12:47 +0200 Subject: [PATCH] this should make clippy happy --- src/ecss.rs | 4 ++-- src/lib.rs | 14 +++++++------- src/tc.rs | 4 ++-- src/time.rs | 4 ++-- src/tm.rs | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/ecss.rs b/src/ecss.rs index e3fef24..b18d2e6 100644 --- a/src/ecss.rs +++ b/src/ecss.rs @@ -12,7 +12,7 @@ pub const CRC_CCITT_FALSE: Crc = Crc::::new(&CRC_16_IBM_3740); pub const CCSDS_HEADER_LEN: usize = size_of::(); /// All PUS versions. Only PUS C is supported by this library. -#[derive(PartialEq, Copy, Clone, Serialize, Deserialize, Debug)] +#[derive(PartialEq, Eq, Copy, Clone, Serialize, Deserialize, Debug)] pub enum PusVersion { EsaPus = 0, PusA = 1, @@ -33,7 +33,7 @@ impl TryFrom for PusVersion { } } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum PusError { VersionNotSupported(PusVersion), IncorrectCrc(u16), diff --git a/src/lib.rs b/src/lib.rs index cefe2a0..4862470 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,12 +59,12 @@ pub mod tc; pub mod time; pub mod tm; -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct SizeMissmatch { pub found: usize, pub expected: usize, } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum PacketError { /// The passed slice is too small. Returns the found and expected minimum size ToBytesSliceTooSmall(SizeMissmatch), @@ -75,7 +75,7 @@ pub enum PacketError { FromBytesZeroCopyError, } -#[derive(Serialize, Deserialize, Debug, PartialEq, Copy, Clone)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Copy, Clone)] pub enum PacketType { Tm = 0, Tc = 1, @@ -97,7 +97,7 @@ pub fn packet_type_in_raw_packet_id(packet_id: u16) -> PacketType { PacketType::try_from((packet_id >> 12) as u8 & 0b1).unwrap() } -#[derive(Serialize, Deserialize, Debug, PartialEq, Copy, Clone)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Copy, Clone)] pub enum SequenceFlags { ContinuationSegment = 0b00, FirstSegment = 0b01, @@ -121,7 +121,7 @@ impl TryFrom for SequenceFlags { } } -#[derive(Serialize, Deserialize, Debug, PartialEq, Copy, Clone)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Copy, Clone)] pub struct PacketId { pub ptype: PacketType, pub sec_header_flag: bool, @@ -168,7 +168,7 @@ impl From for PacketId { } } -#[derive(Serialize, Deserialize, Debug, PartialEq, Copy, Clone)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Copy, Clone)] pub struct PacketSequenceCtrl { pub seq_flags: SequenceFlags, seq_count: u16, @@ -314,7 +314,7 @@ pub trait CcsdsPrimaryHeader { /// 13 bits of the first two bytes of the raw header /// * `psc` - Packet Sequence Control, occupies the third and fourth byte of the raw header /// * `data_len` - Data length field occupies the fifth and the sixth byte of the raw header -#[derive(serde::Serialize, serde::Deserialize, Debug, PartialEq, Copy, Clone)] +#[derive(serde::Serialize, serde::Deserialize, Debug, PartialEq, Eq, Copy, Clone)] pub struct SpHeader { pub version: u8, pub packet_id: PacketId, diff --git a/src/tc.rs b/src/tc.rs index 9d5ac5c..1122a78 100644 --- a/src/tc.rs +++ b/src/tc.rs @@ -134,7 +134,7 @@ pub mod zc { } } -#[derive(PartialEq, Copy, Clone, Serialize, Deserialize, Debug)] +#[derive(PartialEq, Eq, Copy, Clone, Serialize, Deserialize, Debug)] pub struct PusTcSecondaryHeader { pub service: u8, pub subservice: u8, @@ -209,7 +209,7 @@ impl PusTcSecondaryHeader { /// [postcard](https://docs.rs/postcard/latest/postcard/). /// /// There is no spare bytes support yet. -#[derive(PartialEq, Copy, Clone, Serialize, Deserialize, Debug)] +#[derive(PartialEq, Eq, Copy, Clone, Serialize, Deserialize, Debug)] pub struct PusTc<'slice> { sp_header: SpHeader, pub sec_header: PusTcSecondaryHeader, diff --git a/src/time.rs b/src/time.rs index c92e721..5ca4819 100644 --- a/src/time.rs +++ b/src/time.rs @@ -14,7 +14,7 @@ pub const CDS_SHORT_LEN: usize = 7; pub const DAYS_CCSDS_TO_UNIX: i32 = -4383; pub const SECONDS_PER_DAY: u32 = 86400; -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, PartialEq, Eq, Copy, Clone)] pub enum CcsdsTimeCodes { None = 0, CucCcsdsEpoch = 0b001, @@ -38,7 +38,7 @@ impl TryFrom for CcsdsTimeCodes { } } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum TimestampError { /// Contains tuple where first value is the expected time code and the second /// value is the found raw value diff --git a/src/tm.rs b/src/tm.rs index f1511ac..1212803 100644 --- a/src/tm.rs +++ b/src/tm.rs @@ -103,7 +103,7 @@ pub mod zc { } } -#[derive(PartialEq, Serialize, Deserialize, Copy, Clone, Debug)] +#[derive(PartialEq, Eq, Serialize, Deserialize, Copy, Clone, Debug)] pub struct PusTmSecondaryHeader<'slice> { pus_version: PusVersion, pub sc_time_ref_status: u8, @@ -197,7 +197,7 @@ impl<'slice> TryFrom> for PusTmSecondaryHeader<'slice /// [postcard](https://docs.rs/postcard/latest/postcard/). /// /// There is no spare bytes support yet. -#[derive(PartialEq, Serialize, Deserialize, Debug, Copy, Clone)] +#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Copy, Clone)] pub struct PusTm<'slice> { pub sp_header: SpHeader, pub sec_header: PusTmSecondaryHeader<'slice>,