mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-30 18:21:33 +00:00
*: Apply clippy suggestions and enable clippy on CI (#1850)
* *: Apply clippy suggestions * .github: Add clippy check * protocols/kad/record: Implement custom PartialEq for ProviderRecord
This commit is contained in:
@ -63,20 +63,12 @@ impl std::ops::Not for Endpoint {
|
||||
impl Endpoint {
|
||||
/// Is this endpoint a dialer?
|
||||
pub fn is_dialer(self) -> bool {
|
||||
if let Endpoint::Dialer = self {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
matches!(self, Endpoint::Dialer)
|
||||
}
|
||||
|
||||
/// Is this endpoint a listener?
|
||||
pub fn is_listener(self) -> bool {
|
||||
if let Endpoint::Listener = self {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
matches!(self, Endpoint::Listener)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user