Skip to content

Commit

Permalink
Address clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mciantyre committed Nov 28, 2024
1 parent 7634432 commit 88bdb03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/lpspi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1420,12 +1420,12 @@ struct ReceiveBuffer<'a, W> {
_buffer: PhantomData<&'a [W]>,
}

impl<'a, W> ReceiveBuffer<'a, W>
impl<W> ReceiveBuffer<'_, W>
where
W: Word,
{
#[cfg(test)] // TODO(mciantyre) remove once needed in non-test code.
fn new(buffer: &'a mut [W]) -> Self {
fn new(buffer: &mut [W]) -> Self {
// Safety: pointer offset math meets expectations.
unsafe { Self::from_raw(buffer.as_mut_ptr(), buffer.len()) }
}
Expand Down Expand Up @@ -1482,7 +1482,7 @@ const fn per_word<W: Word>() -> usize {

/// Computes how many u32 words we need to transact this buffer.
const fn word_count<W: Word>(words: &[W]) -> usize {
(words.len() + per_word::<W>() - 1) / per_word::<W>()
words.len().div_ceil(per_word::<W>())
}

/// Creates the transmit and receive buffer objects for an
Expand Down

0 comments on commit 88bdb03

Please sign in to comment.