diff --git a/substrate/client/db/src/lib.rs b/substrate/client/db/src/lib.rs index 94535cf28aea5766d70428f3b44529631fda0175..c684245be356db6ae6e6e0cc710e3e1b7454aa79 100644 --- a/substrate/client/db/src/lib.rs +++ b/substrate/client/db/src/lib.rs @@ -335,10 +335,7 @@ impl DatabaseSettingsSrc { } /// Check if database supports internal ref counting for state data. pub fn supports_ref_counting(&self) -> bool { - match self { - DatabaseSettingsSrc::ParityDb { .. } => true, - _ => false, - } + matches!(self, DatabaseSettingsSrc::ParityDb { .. }) } } diff --git a/substrate/primitives/core/src/crypto.rs b/substrate/primitives/core/src/crypto.rs index 7446ab25ce4be0049074d7f2b410d102ebccaa8b..80209a25c411b7964bead7147e71eb796e7a66ff 100644 --- a/substrate/primitives/core/src/crypto.rs +++ b/substrate/primitives/core/src/crypto.rs @@ -161,18 +161,12 @@ impl DeriveJunction { /// Return `true` if the junction is soft. pub fn is_soft(&self) -> bool { - match *self { - DeriveJunction::Soft(_) => true, - _ => false, - } + matches!(*self, DeriveJunction::Soft(_)) } /// Return `true` if the junction is hard. pub fn is_hard(&self) -> bool { - match *self { - DeriveJunction::Hard(_) => true, - _ => false, - } + matches!(*self, DeriveJunction::Hard(_)) } } @@ -401,10 +395,7 @@ macro_rules! ss58_address_format { /// Whether the address is custom. pub fn is_custom(&self) -> bool { - match self { - Self::Custom(_) => true, - _ => false, - } + matches!(self, Self::Custom(_)) } } diff --git a/substrate/primitives/runtime-interface/proc-macro/src/runtime_interface/bare_function_interface.rs b/substrate/primitives/runtime-interface/proc-macro/src/runtime_interface/bare_function_interface.rs index c5d0073e3fb632bd1dda087cabe15036b026aadf..d17067d990c360f62675de9991214bad08cb4bc2 100644 --- a/substrate/primitives/runtime-interface/proc-macro/src/runtime_interface/bare_function_interface.rs +++ b/substrate/primitives/runtime-interface/proc-macro/src/runtime_interface/bare_function_interface.rs @@ -239,8 +239,5 @@ fn generate_call_to_trait( /// Returns if the given `Signature` takes a `self` argument. fn takes_self_argument(sig: &Signature) -> bool { - match sig.inputs.first() { - Some(FnArg::Receiver(_)) => true, - _ => false, - } + matches!(sig.inputs.first(), Some(FnArg::Receiver(_))) }