From 229fcb9f1fe80ace35d912ce0be0c894d4f137c7 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 7 Jun 2022 14:22:38 +1000 Subject: [PATCH] Use if let instead of destructuring pattern Clippy emits: warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` As suggested, use `if let`. --- src/util/psbt/map/input.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/util/psbt/map/input.rs b/src/util/psbt/map/input.rs index 20c6164b..9f8b38f9 100644 --- a/src/util/psbt/map/input.rs +++ b/src/util/psbt/map/input.rs @@ -178,9 +178,8 @@ impl FromStr for PsbtSighashType { // NB: some of Schnorr sighash types are non-standard for pre-taproot // inputs. We also do not support SIGHASH_RESERVED in verbatim form // ("0xFF" string should be used instead). - match SchnorrSighashType::from_str(s) { - Ok(ty) => return Ok(ty.into()), - Err(_) => {} + if let Ok(ty) = SchnorrSighashType::from_str(s) { + return Ok(ty.into()); } // We accept non-standard sighash values.