浏览代码

Don't use matches! macro, for Rust 1.36 support

Dario Nieuwenhuis 4 年之前
父节点
当前提交
c510a96012
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/socket/tcp.rs

+ 5 - 1
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());
             < self.local_seq_no + core::cmp::min(self.remote_win_len, self.tx_buffer.len());
 
 
         // Do we have to send a FIN?
         // 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:
         // Can we actually send the FIN? We can send it if:
         // 1. We have unsent data that fits in the remote window.
         // 1. We have unsent data that fits in the remote window.