From 5d51a642b4dd2a321c6caab569b46d19806032d3 Mon Sep 17 00:00:00 2001 From: xep-c-6yrpa Date: Fri, 13 Dec 2024 20:50:39 +0100 Subject: [PATCH] chore(core): use `matches!` in connection.rs --- core/src/connection.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/core/src/connection.rs b/core/src/connection.rs index 91152b25728..8779f76c03c 100644 --- a/core/src/connection.rs +++ b/core/src/connection.rs @@ -121,18 +121,12 @@ impl ConnectedPoint { /// Returns true if we are `Dialer`. pub fn is_dialer(&self) -> bool { - match self { - ConnectedPoint::Dialer { .. } => true, - ConnectedPoint::Listener { .. } => false, - } + matches!(self, ConnectedPoint::Dialer { .. }) } /// Returns true if we are `Listener`. pub fn is_listener(&self) -> bool { - match self { - ConnectedPoint::Dialer { .. } => false, - ConnectedPoint::Listener { .. } => true, - } + matches!(self, ConnectedPoint::Listener { .. }) } /// Returns true if the connection is relayed.