aboutsummaryrefslogtreecommitdiff
path: root/embassy-net/src/device.rs
diff options
context:
space:
mode:
authorDániel Buga <[email protected]>2023-09-02 07:44:10 +0200
committerDániel Buga <[email protected]>2023-09-02 08:39:52 +0200
commit0c66636d003979c3aecff36c9e03e87f34147a94 (patch)
treed79b1578cb559a40f0bfe8c2a1b33263cecc4364 /embassy-net/src/device.rs
parent8339423a2f194d31f3f26d956f68dfcef46f8891 (diff)
Use fmt::unwrap
Diffstat (limited to 'embassy-net/src/device.rs')
-rw-r--r--embassy-net/src/device.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-net/src/device.rs b/embassy-net/src/device.rs
index d29ab8970..8c2b7d31a 100644
--- a/embassy-net/src/device.rs
+++ b/embassy-net/src/device.rs
@@ -22,13 +22,13 @@ where
22 22
23 fn receive(&mut self, _timestamp: Instant) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)> { 23 fn receive(&mut self, _timestamp: Instant) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)> {
24 self.inner 24 self.inner
25 .receive(self.cx.as_deref_mut().unwrap()) 25 .receive(unwrap!(self.cx.as_deref_mut()))
26 .map(|(rx, tx)| (RxTokenAdapter(rx), TxTokenAdapter(tx))) 26 .map(|(rx, tx)| (RxTokenAdapter(rx), TxTokenAdapter(tx)))
27 } 27 }
28 28
29 /// Construct a transmit token. 29 /// Construct a transmit token.
30 fn transmit(&mut self, _timestamp: Instant) -> Option<Self::TxToken<'_>> { 30 fn transmit(&mut self, _timestamp: Instant) -> Option<Self::TxToken<'_>> {
31 self.inner.transmit(self.cx.as_deref_mut().unwrap()).map(TxTokenAdapter) 31 self.inner.transmit(unwrap!(self.cx.as_deref_mut())).map(TxTokenAdapter)
32 } 32 }
33 33
34 /// Get a description of device capabilities. 34 /// Get a description of device capabilities.