diff options
Diffstat (limited to 'embassy-sync/src/zerocopy_channel.rs')
| -rw-r--r-- | embassy-sync/src/zerocopy_channel.rs | 10 |
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 | ||
| 17 | use core::cell::RefCell; | 17 | use core::cell::RefCell; |
| 18 | use core::future::{poll_fn, Future}; | 18 | use core::future::{Future, poll_fn}; |
| 19 | use core::marker::PhantomData; | 19 | use core::marker::PhantomData; |
| 20 | use core::task::{Context, Poll}; | 20 | use core::task::{Context, Poll}; |
| 21 | 21 | ||
| 22 | use crate::blocking_mutex::raw::RawMutex; | ||
| 23 | use crate::blocking_mutex::Mutex; | 22 | use crate::blocking_mutex::Mutex; |
| 23 | use crate::blocking_mutex::raw::RawMutex; | ||
| 24 | use crate::waitqueue::WakerRegistration; | 24 | use 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 | ||
| 297 | impl State { | 297 | impl 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) { |
