Constraint the use of ChannelCell to just channels

This commit is contained in:
huntc 2021-07-08 11:09:02 +10:00
parent ae62948d6c
commit 3fdf61c819

View file

@ -60,7 +60,10 @@ pub struct ChannelCell<T: ?Sized> {
impl<T> ChannelCell<T> {
#[inline(always)]
pub const fn new(value: T) -> ChannelCell<T> {
pub const fn new<U>(value: T) -> ChannelCell<T>
where
T: ChannelLike<U>,
{
ChannelCell { _value: value }
}
}