Skip to content

Commit

Permalink
chore(core): use matches! in connection.rs
Browse files Browse the repository at this point in the history
Pull-Request: #5740.
  • Loading branch information
xep-c-6yrpa authored Dec 14, 2024
1 parent 89af870 commit ebc01e6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions core/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ebc01e6

Please sign in to comment.