From 0f8f4c560942c888978024dce9ce641909763ccb Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 7 Jun 2022 14:24:44 +1000 Subject: [PATCH] Collapse if statements Clippy emits: warning: this `if` statement can be collapsed As suggested, collapse the if statements into a single statement, with no loss of clarity. --- src/util/address.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/address.rs b/src/util/address.rs index 68939625..cfb1ff7e 100644 --- a/src/util/address.rs +++ b/src/util/address.rs @@ -693,10 +693,10 @@ impl Address { /// Constructs an [`Address`] from an output script (`scriptPubkey`). pub fn from_script(script: &script::Script, network: Network) -> Option
{ - if script.is_witness_program() { - if script.witness_version() == Some(WitnessVersion::V0) && !(script.is_v0_p2wpkh() || script.is_v0_p2wsh()) { + if script.is_witness_program() + && script.witness_version() == Some(WitnessVersion::V0) + && !(script.is_v0_p2wpkh() || script.is_v0_p2wsh()) { return None - } } Some(Address {