mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-12-04 12:42:44 +00:00
remove option
This commit is contained in:
parent
32f0cde1cc
commit
730dde9ba9
@ -310,11 +310,11 @@ impl<M: RawMutex, T: Clone, const N: usize> Watch<M, T, N> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new `Watch` channel.
|
/// Create a new `Watch` channel with default data.
|
||||||
pub const fn new_with(data: Option<T>) -> Self {
|
pub const fn new_with(data: T) -> Self {
|
||||||
Self {
|
Self {
|
||||||
mutex: Mutex::new(RefCell::new(WatchState {
|
mutex: Mutex::new(RefCell::new(WatchState {
|
||||||
data,
|
data: Some(data),
|
||||||
current_id: 0,
|
current_id: 0,
|
||||||
wakers: MultiWakerRegistration::new(),
|
wakers: MultiWakerRegistration::new(),
|
||||||
receiver_count: 0,
|
receiver_count: 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user