Skip to content

Commit ebc01e6

Browse files
authored
chore(core): use matches! in connection.rs
Pull-Request: #5740.
1 parent 89af870 commit ebc01e6

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

core/src/connection.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,12 @@ impl ConnectedPoint {
121121

122122
/// Returns true if we are `Dialer`.
123123
pub fn is_dialer(&self) -> bool {
124-
match self {
125-
ConnectedPoint::Dialer { .. } => true,
126-
ConnectedPoint::Listener { .. } => false,
127-
}
124+
matches!(self, ConnectedPoint::Dialer { .. })
128125
}
129126

130127
/// Returns true if we are `Listener`.
131128
pub fn is_listener(&self) -> bool {
132-
match self {
133-
ConnectedPoint::Dialer { .. } => false,
134-
ConnectedPoint::Listener { .. } => true,
135-
}
129+
matches!(self, ConnectedPoint::Listener { .. })
136130
}
137131

138132
/// Returns true if the connection is relayed.

0 commit comments

Comments
 (0)