diff options
| author | Grant Miller <[email protected]> | 2023-02-24 13:01:41 -0600 |
|---|---|---|
| committer | Grant Miller <[email protected]> | 2023-02-24 13:01:41 -0600 |
| commit | 7be4337de96de9948632bdc2fc5067d0c4a76b33 (patch) | |
| tree | ad08ac1de1774914dff63b4b23ad0efd8f9b3da6 /embassy-sync/src/channel.rs | |
| parent | 2209bef4f22bf77d9d52cda0a0ea40485cc2747a (diff) | |
Add `#[must_use]` to all futures
Diffstat (limited to 'embassy-sync/src/channel.rs')
| -rw-r--r-- | embassy-sync/src/channel.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/embassy-sync/src/channel.rs b/embassy-sync/src/channel.rs index 76f42d0e7..77352874d 100644 --- a/embassy-sync/src/channel.rs +++ b/embassy-sync/src/channel.rs | |||
| @@ -181,6 +181,7 @@ where | |||
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | /// Future returned by [`Channel::recv`] and [`Receiver::recv`]. | 183 | /// Future returned by [`Channel::recv`] and [`Receiver::recv`]. |
| 184 | #[must_use = "futures do nothing unless you `.await` or poll them"] | ||
| 184 | pub struct RecvFuture<'ch, M, T, const N: usize> | 185 | pub struct RecvFuture<'ch, M, T, const N: usize> |
| 185 | where | 186 | where |
| 186 | M: RawMutex, | 187 | M: RawMutex, |
| @@ -203,6 +204,7 @@ where | |||
| 203 | } | 204 | } |
| 204 | 205 | ||
| 205 | /// Future returned by [`DynamicReceiver::recv`]. | 206 | /// Future returned by [`DynamicReceiver::recv`]. |
| 207 | #[must_use = "futures do nothing unless you `.await` or poll them"] | ||
| 206 | pub struct DynamicRecvFuture<'ch, T> { | 208 | pub struct DynamicRecvFuture<'ch, T> { |
| 207 | channel: &'ch dyn DynamicChannel<T>, | 209 | channel: &'ch dyn DynamicChannel<T>, |
| 208 | } | 210 | } |
| @@ -219,6 +221,7 @@ impl<'ch, T> Future for DynamicRecvFuture<'ch, T> { | |||
| 219 | } | 221 | } |
| 220 | 222 | ||
| 221 | /// Future returned by [`Channel::send`] and [`Sender::send`]. | 223 | /// Future returned by [`Channel::send`] and [`Sender::send`]. |
| 224 | #[must_use = "futures do nothing unless you `.await` or poll them"] | ||
| 222 | pub struct SendFuture<'ch, M, T, const N: usize> | 225 | pub struct SendFuture<'ch, M, T, const N: usize> |
| 223 | where | 226 | where |
| 224 | M: RawMutex, | 227 | M: RawMutex, |
| @@ -250,6 +253,7 @@ where | |||
| 250 | impl<'ch, M, T, const N: usize> Unpin for SendFuture<'ch, M, T, N> where M: RawMutex {} | 253 | impl<'ch, M, T, const N: usize> Unpin for SendFuture<'ch, M, T, N> where M: RawMutex {} |
| 251 | 254 | ||
| 252 | /// Future returned by [`DynamicSender::send`]. | 255 | /// Future returned by [`DynamicSender::send`]. |
| 256 | #[must_use = "futures do nothing unless you `.await` or poll them"] | ||
| 253 | pub struct DynamicSendFuture<'ch, T> { | 257 | pub struct DynamicSendFuture<'ch, T> { |
| 254 | channel: &'ch dyn DynamicChannel<T>, | 258 | channel: &'ch dyn DynamicChannel<T>, |
| 255 | message: Option<T>, | 259 | message: Option<T>, |
