Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: use `matches!` over `[].contains`
Fintan Halpenny committed 7 months ago
commit 5ca3fefc6a7e0a54659638444206302f7106671b
parent 0c641dccc78175566330ebdd6276d37a5569b3cf
1 file changed +7 -7
modified crates/radicle-node/src/reactor/transport.rs
@@ -197,13 +197,13 @@ impl<S: Session> Transport<S> {
            // In this case, the write could not complete. Leave `needs_flush` set
            // to be notified when the socket is ready to write again.
            Err(err)
-
                if [
-
                    io::ErrorKind::WouldBlock,
-
                    io::ErrorKind::WriteZero,
-
                    io::ErrorKind::OutOfMemory,
-
                    io::ErrorKind::Interrupted,
-
                ]
-
                .contains(&err.kind()) =>
+
                if matches!(
+
                    err.kind(),
+
                    io::ErrorKind::WouldBlock
+
                        | io::ErrorKind::WriteZero
+
                        | io::ErrorKind::OutOfMemory
+
                        | io::ErrorKind::Interrupted
+
                ) =>
            {
                log::warn!(target: "transport", "Resource {} was not able to consume any data even though it has announced its write readiness", self.display());
                self.write_intent = true;