mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-16 04:45:19 +01:00
put the size check of the channel constructor in explicit const block
This commit is contained in:
parent
fbd472ec06
commit
8dee5b20ff
1 changed files with 2 additions and 2 deletions
|
|
@ -84,7 +84,7 @@ impl<T, const N: usize> Channel<T, N> {
|
|||
/// Create a new channel.
|
||||
#[cfg(not(loom))]
|
||||
pub const fn new() -> Self {
|
||||
Self::size_check();
|
||||
const { Self::size_check() };
|
||||
Self {
|
||||
freeq: UnsafeCell::new(Deque::new()),
|
||||
readyq: UnsafeCell::new(Deque::new()),
|
||||
|
|
@ -99,7 +99,7 @@ impl<T, const N: usize> Channel<T, N> {
|
|||
/// Create a new channel.
|
||||
#[cfg(loom)]
|
||||
pub fn new() -> Self {
|
||||
Self::size_check();
|
||||
const { Self::size_check() };
|
||||
Self {
|
||||
freeq: UnsafeCell::new(Deque::new()),
|
||||
readyq: UnsafeCell::new(Deque::new()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue