mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-16 12:55:23 +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.
|
/// Create a new channel.
|
||||||
#[cfg(not(loom))]
|
#[cfg(not(loom))]
|
||||||
pub const fn new() -> Self {
|
pub const fn new() -> Self {
|
||||||
Self::size_check();
|
const { Self::size_check() };
|
||||||
Self {
|
Self {
|
||||||
freeq: UnsafeCell::new(Deque::new()),
|
freeq: UnsafeCell::new(Deque::new()),
|
||||||
readyq: 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.
|
/// Create a new channel.
|
||||||
#[cfg(loom)]
|
#[cfg(loom)]
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self::size_check();
|
const { Self::size_check() };
|
||||||
Self {
|
Self {
|
||||||
freeq: UnsafeCell::new(Deque::new()),
|
freeq: UnsafeCell::new(Deque::new()),
|
||||||
readyq: UnsafeCell::new(Deque::new()),
|
readyq: UnsafeCell::new(Deque::new()),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue