From c5ce02b30e488aade19f9f859425aa127d085b92 Mon Sep 17 00:00:00 2001 From: ivmarkov Date: Sat, 24 Sep 2022 12:08:46 +0300 Subject: Remove default, reorder generic params --- embassy-sync/src/signal.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'embassy-sync') diff --git a/embassy-sync/src/signal.rs b/embassy-sync/src/signal.rs index 8cb832a2b..c3c10a8af 100644 --- a/embassy-sync/src/signal.rs +++ b/embassy-sync/src/signal.rs @@ -3,7 +3,7 @@ use core::cell::Cell; use core::future::{poll_fn, Future}; use core::task::{Context, Poll, Waker}; -use crate::blocking_mutex::raw::{CriticalSectionRawMutex, RawMutex}; +use crate::blocking_mutex::raw::RawMutex; use crate::blocking_mutex::Mutex; /// Single-slot signaling primitive. @@ -22,19 +22,20 @@ use crate::blocking_mutex::Mutex; /// /// ``` /// use embassy_sync::signal::Signal; +/// use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; /// /// enum SomeCommand { /// On, /// Off, /// } /// -/// static SOME_SIGNAL: Signal = Signal::new(); +/// static SOME_SIGNAL: Signal = Signal::new(); /// ``` -pub struct Signal +pub struct Signal where - R: RawMutex, + M: RawMutex, { - state: Mutex>>, + state: Mutex>>, } enum State { @@ -43,9 +44,9 @@ enum State { Signaled(T), } -impl Signal +impl Signal where - R: RawMutex, + M: RawMutex, { /// Create a new `Signal`. pub const fn new() -> Self { @@ -55,9 +56,9 @@ where } } -impl Signal +impl Signal where - R: RawMutex, + M: RawMutex, { /// Mark this Signal as signaled. pub fn signal(&self, val: T) { -- cgit