aboutsummaryrefslogtreecommitdiff
path: root/embassy-sync/src/zerocopy_channel.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-sync/src/zerocopy_channel.rs')
-rw-r--r--embassy-sync/src/zerocopy_channel.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/embassy-sync/src/zerocopy_channel.rs b/embassy-sync/src/zerocopy_channel.rs
index b3f7dbe8c..c572592b8 100644
--- a/embassy-sync/src/zerocopy_channel.rs
+++ b/embassy-sync/src/zerocopy_channel.rs
@@ -15,12 +15,12 @@
15//! another message will result in an error being returned. 15//! another message will result in an error being returned.
16 16
17use core::cell::RefCell; 17use core::cell::RefCell;
18use core::future::{poll_fn, Future}; 18use core::future::{Future, poll_fn};
19use core::marker::PhantomData; 19use core::marker::PhantomData;
20use core::task::{Context, Poll}; 20use core::task::{Context, Poll};
21 21
22use crate::blocking_mutex::raw::RawMutex;
23use crate::blocking_mutex::Mutex; 22use crate::blocking_mutex::Mutex;
23use crate::blocking_mutex::raw::RawMutex;
24use crate::waitqueue::WakerRegistration; 24use crate::waitqueue::WakerRegistration;
25 25
26/// A bounded zero-copy channel for communicating between asynchronous tasks 26/// A bounded zero-copy channel for communicating between asynchronous tasks
@@ -296,11 +296,7 @@ struct State {
296 296
297impl State { 297impl State {
298 fn increment(&self, i: usize) -> usize { 298 fn increment(&self, i: usize) -> usize {
299 if i + 1 == self.capacity { 299 if i + 1 == self.capacity { 0 } else { i + 1 }
300 0
301 } else {
302 i + 1
303 }
304 } 300 }
305 301
306 fn clear(&mut self) { 302 fn clear(&mut self) {