Skip to content

Commit

Permalink
Remove unused associated constants from trait
Browse files Browse the repository at this point in the history
These were prototyping leftovers from f4a369e. clippy in the beta
release train has started to detect them, so I assume they'll find their
way into the next stable clippy release.
  • Loading branch information
mciantyre committed Jun 13, 2024
1 parent 95dbb97 commit 5969e7c
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/common/lpspi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,9 +1288,6 @@ impl<P, const N: u8> eh02::blocking::spi::Write<u32> for Lpspi<P, N> {

/// Describes SPI words that can participate in transactions.
trait Word: Copy + Into<u32> + TryFrom<u32> {
const MAX: Self;
const ZERO: Self;

/// Repeatedly call `provider` to produce yourself,
/// then turn yourself into a LPSPI word.
fn pack_word(bit_order: BitOrder, provider: impl FnMut() -> Option<Self>) -> u32;
Expand All @@ -1301,8 +1298,6 @@ trait Word: Copy + Into<u32> + TryFrom<u32> {
}

impl Word for u8 {
const MAX: u8 = u8::MAX;
const ZERO: u8 = 0;
fn pack_word(bit_order: BitOrder, mut provider: impl FnMut() -> Option<Self>) -> u32 {
let mut word = 0;
match bit_order {
Expand Down Expand Up @@ -1333,8 +1328,6 @@ impl Word for u8 {
}

impl Word for u16 {
const MAX: u16 = u16::MAX;
const ZERO: u16 = 0;
fn pack_word(bit_order: BitOrder, mut provider: impl FnMut() -> Option<Self>) -> u32 {
let mut word = 0;
match bit_order {
Expand Down Expand Up @@ -1365,8 +1358,6 @@ impl Word for u16 {
}

impl Word for u32 {
const MAX: u32 = u32::MAX;
const ZERO: u32 = 0;
fn pack_word(_: BitOrder, mut provider: impl FnMut() -> Option<Self>) -> u32 {
provider().unwrap_or(0)
}
Expand Down

0 comments on commit 5969e7c

Please sign in to comment.