aboutsummaryrefslogtreecommitdiff
path: root/embassy-net/src/tcp.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/tcp.rs
parent8339423a2f194d31f3f26d956f68dfcef46f8891 (diff)
Use fmt::unwrap
Diffstat (limited to 'embassy-net/src/tcp.rs')
-rw-r--r--embassy-net/src/tcp.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-net/src/tcp.rs b/embassy-net/src/tcp.rs
index c92ad2d2e..a12fd382a 100644
--- a/embassy-net/src/tcp.rs
+++ b/embassy-net/src/tcp.rs
@@ -440,7 +440,7 @@ impl<'d> TcpIo<'d> {
440 Poll::Ready(Err(Error::ConnectionReset)) 440 Poll::Ready(Err(Error::ConnectionReset))
441 } 441 }
442 } else { 442 } else {
443 Poll::Ready(match s.send(f.take().unwrap()) { 443 Poll::Ready(match s.send(unwrap!(f.take())) {
444 // Connection reset. TODO: this can also be timeouts etc, investigate. 444 // Connection reset. TODO: this can also be timeouts etc, investigate.
445 Err(tcp::SendError::InvalidState) => Err(Error::ConnectionReset), 445 Err(tcp::SendError::InvalidState) => Err(Error::ConnectionReset),
446 Ok(r) => Ok(r), 446 Ok(r) => Ok(r),
@@ -468,7 +468,7 @@ impl<'d> TcpIo<'d> {
468 Poll::Ready(Err(Error::ConnectionReset)) 468 Poll::Ready(Err(Error::ConnectionReset))
469 } 469 }
470 } else { 470 } else {
471 Poll::Ready(match s.recv(f.take().unwrap()) { 471 Poll::Ready(match s.recv(unwrap!(f.take())) {
472 // Connection reset. TODO: this can also be timeouts etc, investigate. 472 // Connection reset. TODO: this can also be timeouts etc, investigate.
473 Err(tcp::RecvError::Finished) | Err(tcp::RecvError::InvalidState) => { 473 Err(tcp::RecvError::Finished) | Err(tcp::RecvError::InvalidState) => {
474 Err(Error::ConnectionReset) 474 Err(Error::ConnectionReset)