diff --git a/sqlx-postgres/src/listener.rs b/sqlx-postgres/src/listener.rs index ca245058af..b96f8d829f 100644 --- a/sqlx-postgres/src/listener.rs +++ b/sqlx-postgres/src/listener.rs @@ -279,11 +279,14 @@ impl PgListener { // The connection is dead, ensure that it is dropped, // update self state, and loop to try again. Err(Error::Io(err)) - if (err.kind() == io::ErrorKind::ConnectionAborted - || err.kind() == io::ErrorKind::UnexpectedEof + if matches!( + err.kind(), + io::ErrorKind::ConnectionAborted | + io::ErrorKind::UnexpectedEof | // see ERRORS section in tcp(7) man page (https://man7.org/linux/man-pages/man7/tcp.7.html) - || err.kind() == io::ErrorKind::TimedOut - || err.kind() == io::ErrorKind::BrokenPipe) => + io::ErrorKind::TimedOut | + io::ErrorKind::BrokenPipe + ) => { if let Some(mut conn) = self.connection.take() { self.buffer_tx = conn.inner.stream.notifications.take();