Skip to content

Commit 73e6a69

Browse files
committed
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`.
1 parent e9e9177 commit 73e6a69

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/util/psbt/map/input.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,8 @@ impl FromStr for PsbtSighashType {
178178
// NB: some of Schnorr sighash types are non-standard for pre-taproot
179179
// inputs. We also do not support SIGHASH_RESERVED in verbatim form
180180
// ("0xFF" string should be used instead).
181-
match SchnorrSighashType::from_str(s) {
182-
Ok(ty) => return Ok(ty.into()),
183-
Err(_) => {}
181+
if let Ok(ty) = SchnorrSighashType::from_str(s) {
182+
return Ok(ty.into());
184183
}
185184

186185
// We accept non-standard sighash values.

0 commit comments

Comments
 (0)