Give up on suppressing that nightly-only clippy warning

This commit is contained in:
Nick Mathewson 2020-09-18 19:28:55 -04:00
parent 5e1e77a363
commit 5f54be2234
2 changed files with 21 additions and 27 deletions

View File

@ -181,15 +181,11 @@ pub enum RouterWeight {
impl RouterWeight {
/// Return true if this weight is the result of a successful measurement
pub fn is_measured(&self) -> bool {
#[allow(clippy::match_like_matches_macro)]
match self {
RouterWeight::Measured(x) if x > &0 => true,
_ => false,
}
matches!(self,
RouterWeight::Measured(x) if x > &0)
}
/// Return true if this weight is nonzero
pub fn is_nonzero(&self) -> bool {
#[allow(clippy::match_like_matches_macro)]
match self {
RouterWeight::Unmeasured(0) => false,
RouterWeight::Measured(0) => false,

View File

@ -101,31 +101,29 @@ impl ChanCmd {
}
/// Return true if this command is one that we recognize.
pub fn is_recognized(self) -> bool {
#[allow(clippy::match_like_matches_macro)]
match self {
matches!(
self,
ChanCmd::PADDING
| ChanCmd::NETINFO
| ChanCmd::PADDING_NEGOTIATE
| ChanCmd::VERSIONS
| ChanCmd::VPADDING
| ChanCmd::CERTS
| ChanCmd::AUTH_CHALLENGE
| ChanCmd::AUTHENTICATE
| ChanCmd::CREATE
| ChanCmd::CREATED
| ChanCmd::RELAY
| ChanCmd::DESTROY
| ChanCmd::CREATE_FAST
| ChanCmd::CREATED_FAST
| ChanCmd::RELAY_EARLY
| ChanCmd::CREATE2
| ChanCmd::CREATED2 => true,
_ => false,
}
| ChanCmd::NETINFO
| ChanCmd::PADDING_NEGOTIATE
| ChanCmd::VERSIONS
| ChanCmd::VPADDING
| ChanCmd::CERTS
| ChanCmd::AUTH_CHALLENGE
| ChanCmd::AUTHENTICATE
| ChanCmd::CREATE
| ChanCmd::CREATED
| ChanCmd::RELAY
| ChanCmd::DESTROY
| ChanCmd::CREATE_FAST
| ChanCmd::CREATED_FAST
| ChanCmd::RELAY_EARLY
| ChanCmd::CREATE2
| ChanCmd::CREATED2
)
}
/// Return true if this command is one that expects a nonzero circid.
pub fn allows_circid(self) -> bool {
#[allow(clippy::match_like_matches_macro)]
match self {
ChanCmd::PADDING
| ChanCmd::NETINFO