We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
matches!
1 parent 89af870 commit ebc01e6Copy full SHA for ebc01e6
core/src/connection.rs
@@ -121,18 +121,12 @@ impl ConnectedPoint {
121
122
/// Returns true if we are `Dialer`.
123
pub fn is_dialer(&self) -> bool {
124
- match self {
125
- ConnectedPoint::Dialer { .. } => true,
126
- ConnectedPoint::Listener { .. } => false,
127
- }
+ matches!(self, ConnectedPoint::Dialer { .. })
128
}
129
130
/// Returns true if we are `Listener`.
131
pub fn is_listener(&self) -> bool {
132
133
- ConnectedPoint::Dialer { .. } => false,
134
- ConnectedPoint::Listener { .. } => true,
135
+ matches!(self, ConnectedPoint::Listener { .. })
136
137
138
/// Returns true if the connection is relayed.
0 commit comments