diff options
| author | Dániel Buga <[email protected]> | 2023-09-02 07:44:10 +0200 |
|---|---|---|
| committer | Dániel Buga <[email protected]> | 2023-09-02 08:39:52 +0200 |
| commit | 0c66636d003979c3aecff36c9e03e87f34147a94 (patch) | |
| tree | d79b1578cb559a40f0bfe8c2a1b33263cecc4364 /embassy-sync/src/channel.rs | |
| parent | 8339423a2f194d31f3f26d956f68dfcef46f8891 (diff) | |
Use fmt::unwrap
Diffstat (limited to 'embassy-sync/src/channel.rs')
| -rw-r--r-- | embassy-sync/src/channel.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/embassy-sync/src/channel.rs b/embassy-sync/src/channel.rs index 62ea1307d..a512e0c41 100644 --- a/embassy-sync/src/channel.rs +++ b/embassy-sync/src/channel.rs | |||
| @@ -471,7 +471,7 @@ where | |||
| 471 | } | 471 | } |
| 472 | 472 | ||
| 473 | fn lock<R>(&self, f: impl FnOnce(&mut ChannelState<T, N>) -> R) -> R { | 473 | fn lock<R>(&self, f: impl FnOnce(&mut ChannelState<T, N>) -> R) -> R { |
| 474 | self.inner.lock(|rc| f(&mut *rc.borrow_mut())) | 474 | self.inner.lock(|rc| f(&mut *unwrap!(rc.try_borrow_mut()))) |
| 475 | } | 475 | } |
| 476 | 476 | ||
| 477 | fn try_receive_with_context(&self, cx: Option<&mut Context<'_>>) -> Result<T, TryReceiveError> { | 477 | fn try_receive_with_context(&self, cx: Option<&mut Context<'_>>) -> Result<T, TryReceiveError> { |
