Skip to content

Commit

Permalink
Clippy fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
madninja committed Aug 2, 2023
1 parent 3b9d4ed commit e77a030
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/packet/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ pub mod data_rate {
}
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Default)]
pub enum SpreadingFactor {
SF5,
SF6,
#[default]
SF7,
SF8,
SF9,
Expand All @@ -97,12 +98,6 @@ pub mod data_rate {
}
}

impl Default for SpreadingFactor {
fn default() -> Self {
SpreadingFactor::SF7
}
}

impl SpreadingFactor {
pub fn to_u8(&self) -> u8 {
match self {
Expand All @@ -118,9 +113,10 @@ pub mod data_rate {
}
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Default)]
pub enum Bandwidth {
BW125,
#[default]
BW250,
BW500,
}
Expand Down Expand Up @@ -149,12 +145,6 @@ pub mod data_rate {
}
}

impl Default for Bandwidth {
fn default() -> Self {
Bandwidth::BW250
}
}

impl Bandwidth {
pub fn to_hz(&self) -> u32 {
match self {
Expand Down

0 comments on commit e77a030

Please sign in to comment.