mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-16 21:05:35 +01:00
rtic-sync: add note about assert & update another to debug_assert
This commit is contained in:
parent
39d967bf49
commit
dae55bd7e4
1 changed files with 3 additions and 1 deletions
|
|
@ -110,6 +110,8 @@ impl<T, const N: usize> Channel<T, N> {
|
|||
|
||||
// Fill free queue
|
||||
for idx in 0..N as u8 {
|
||||
// NOTE(assert): `split`-ing does not put `freeq` into a known-empty
|
||||
// state, so `debug_assert` is not good enough.
|
||||
assert!(!freeq.is_full());
|
||||
|
||||
// SAFETY: This safe as the loop goes from 0 to the capacity of the underlying queue.
|
||||
|
|
@ -118,7 +120,7 @@ impl<T, const N: usize> Channel<T, N> {
|
|||
}
|
||||
}
|
||||
|
||||
assert!(freeq.is_full());
|
||||
debug_assert!(freeq.is_full());
|
||||
|
||||
// There is now 1 sender
|
||||
// SAFETY: we have exclusive access to `self`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue