*: 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:
Max Inden
2020-11-24 15:59:22 +01:00
committed by GitHub
parent 5e21806a38
commit e3af8b7d03
22 changed files with 108 additions and 111 deletions

View File

@ -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)
}
}