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

@ -440,7 +440,7 @@ impl<'d> TcpIo<'d> {
Poll::Ready(Err(Error::ConnectionReset))
}
} else {
Poll::Ready(match s.send(f.take().unwrap()) {
Poll::Ready(match s.send(unwrap!(f.take())) {
// Connection reset. TODO: this can also be timeouts etc, investigate.
Err(tcp::SendError::InvalidState) => Err(Error::ConnectionReset),
Ok(r) => Ok(r),
@ -468,7 +468,7 @@ impl<'d> TcpIo<'d> {
Poll::Ready(Err(Error::ConnectionReset))
}
} else {
Poll::Ready(match s.recv(f.take().unwrap()) {
Poll::Ready(match s.recv(unwrap!(f.take())) {
// Connection reset. TODO: this can also be timeouts etc, investigate.
Err(tcp::RecvError::Finished) | Err(tcp::RecvError::InvalidState) => {
Err(Error::ConnectionReset)