From d9ad6feac0b470dd120471c7eb7add6e7aa5c57b Mon Sep 17 00:00:00 2001 From: Mike Ruje Date: Wed, 19 Apr 2023 11:03:56 +0200 Subject: [PATCH] Improve has good jugement (#13952) * improve run_benchmark * Revert "improve run_benchmark" This reverts commit 4d9cf7a63e37fedca376d692f1461486d3dca659. * improve has_good_judgement * Update bin/node/runtime/src/impls.rs * ".git/.scripts/commands/fmt/fmt.sh" --------- Co-authored-by: Oliver Tale-Yazdi Co-authored-by: command-bot <> --- substrate/bin/node/runtime/src/impls.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/substrate/bin/node/runtime/src/impls.rs b/substrate/bin/node/runtime/src/impls.rs index 033549549a..05531f47c6 100644 --- a/substrate/bin/node/runtime/src/impls.rs +++ b/substrate/bin/node/runtime/src/impls.rs @@ -61,15 +61,13 @@ impl IdentityVerifier for AllianceIdentityVerifier { fn has_good_judgement(who: &AccountId) -> bool { use pallet_identity::Judgement; - if let Some(judgements) = - crate::Identity::identity(who).map(|registration| registration.judgements) - { - judgements - .iter() - .any(|(_, j)| matches!(j, Judgement::KnownGood | Judgement::Reasonable)) - } else { - false - } + crate::Identity::identity(who) + .map(|registration| registration.judgements) + .map_or(false, |judgements| { + judgements + .iter() + .any(|(_, j)| matches!(j, Judgement::KnownGood | Judgement::Reasonable)) + }) } fn super_account_id(who: &AccountId) -> Option {