From 9af70e93b74495e62304a856695833fa922f036e Mon Sep 17 00:00:00 2001 From: Guillaume Thiolliere Date: Tue, 2 Mar 2021 19:03:05 +0100 Subject: [PATCH] make use of matches (#8211) --- substrate/frame/elections-phragmen/src/lib.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/substrate/frame/elections-phragmen/src/lib.rs b/substrate/frame/elections-phragmen/src/lib.rs index d4676e98b8..d3b12d127a 100644 --- a/substrate/frame/elections-phragmen/src/lib.rs +++ b/substrate/frame/elections-phragmen/src/lib.rs @@ -2427,17 +2427,14 @@ mod tests { // no replacement yet. let unwrapped_error = Elections::remove_member(Origin::root(), 4, true).unwrap_err(); - matches!( + assert!(matches!( unwrapped_error.error, DispatchError::Module { message: Some("InvalidReplacement"), .. } - ); - matches!( - unwrapped_error.post_info.actual_weight, - Some(x) if x < ::BlockWeights::get().max_block - ); + )); + assert!(unwrapped_error.post_info.actual_weight.is_some()); }); ExtBuilder::default().desired_runners_up(1).build_and_execute(|| { @@ -2456,17 +2453,14 @@ mod tests { // there is a replacement! and this one needs a weight refund. let unwrapped_error = Elections::remove_member(Origin::root(), 4, false).unwrap_err(); - matches!( + assert!(matches!( unwrapped_error.error, DispatchError::Module { message: Some("InvalidReplacement"), .. } - ); - matches!( - unwrapped_error.post_info.actual_weight, - Some(x) if x < ::BlockWeights::get().max_block - ); + )); + assert!(unwrapped_error.post_info.actual_weight.is_some()); }); }