Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Jan 30, 2025
1 parent 518a641 commit 37d623b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ impl VariableLengthSignal {
/// - `capacity` is the number of [`Pulse`]s which can be pushes before reallocating
pub fn with_capacity(capacity: usize) -> Self {
// half the size, rounding up, because each entry in the [`Vec`] holds upto 2 pulses each
let vec_size = (capacity + 1) / 2;
let vec_size = capacity.div_ceil(2);
Self {
items: alloc::vec::Vec::with_capacity(vec_size),
next_item_is_new: true,
Expand Down
7 changes: 6 additions & 1 deletion src/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2098,7 +2098,12 @@ impl Owner {
Owner::Borrowed => false,
Owner::Shared => REFS[port as usize].fetch_sub(1, Ordering::SeqCst) == 0,
};
needs_drop.then(|| delete_driver(port)).unwrap_or(Ok(()))

if needs_drop {
delete_driver(port)
} else {
Ok(())
}
}
}

Expand Down

0 comments on commit 37d623b

Please sign in to comment.