From a7d3f604a36ad08323efc941003b80aaf9be016c Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sat, 26 Dec 2020 03:12:48 +0100 Subject: [PATCH] Don't use matches! macro, for Rust 1.36 support --- src/socket/tcp.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/socket/tcp.rs b/src/socket/tcp.rs index 8eaca3c..86229fd 100644 --- a/src/socket/tcp.rs +++ b/src/socket/tcp.rs @@ -1408,7 +1408,11 @@ impl<'a> TcpSocket<'a> { < self.local_seq_no + core::cmp::min(self.remote_win_len, self.tx_buffer.len()); // Do we have to send a FIN? - let want_fin = matches!(self.state, State::FinWait1 | State::LastAck); + let want_fin = match self.state { + State::FinWait1 => true, + State::LastAck => true, + _ => false, + }; // Can we actually send the FIN? We can send it if: // 1. We have unsent data that fits in the remote window.