From 3fdf61c819d4612c721d846faf9821170f5f75a3 Mon Sep 17 00:00:00 2001 From: huntc Date: Thu, 8 Jul 2021 11:09:02 +1000 Subject: [PATCH] Constraint the use of ChannelCell to just channels --- embassy/src/util/mpsc.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/embassy/src/util/mpsc.rs b/embassy/src/util/mpsc.rs index aabced416..354c3e95c 100644 --- a/embassy/src/util/mpsc.rs +++ b/embassy/src/util/mpsc.rs @@ -60,7 +60,10 @@ pub struct ChannelCell { impl ChannelCell { #[inline(always)] - pub const fn new(value: T) -> ChannelCell { + pub const fn new(value: T) -> ChannelCell + where + T: ChannelLike, + { ChannelCell { _value: value } } }