Use fmt::unwrap

This commit is contained in:
Dániel Buga
2023-09-02 07:44:10 +02:00
parent 8339423a2f
commit 0c66636d00
6 changed files with 14 additions and 14 deletions

View File

@ -22,13 +22,13 @@ where
fn receive(&mut self, _timestamp: Instant) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)> {
self.inner
.receive(self.cx.as_deref_mut().unwrap())
.receive(unwrap!(self.cx.as_deref_mut()))
.map(|(rx, tx)| (RxTokenAdapter(rx), TxTokenAdapter(tx)))
}
/// Construct a transmit token.
fn transmit(&mut self, _timestamp: Instant) -> Option<Self::TxToken<'_>> {
self.inner.transmit(self.cx.as_deref_mut().unwrap()).map(TxTokenAdapter)
self.inner.transmit(unwrap!(self.cx.as_deref_mut())).map(TxTokenAdapter)
}
/// Get a description of device capabilities.