mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 13:01:07 +00:00
Improve match statement (#8817)
This commit is contained in:
@@ -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 { .. })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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(_))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -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(_)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user