Skip to content

Commit dbaf996

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

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/util/address.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,10 +693,10 @@ impl Address {
693693

694694
/// Constructs an [`Address`] from an output script (`scriptPubkey`).
695695
pub fn from_script(script: &script::Script, network: Network) -> Option<Address> {
696-
if script.is_witness_program() {
697-
if script.witness_version() == Some(WitnessVersion::V0) && !(script.is_v0_p2wpkh() || script.is_v0_p2wsh()) {
696+
if script.is_witness_program()
697+
&& script.witness_version() == Some(WitnessVersion::V0)
698+
&& !(script.is_v0_p2wpkh() || script.is_v0_p2wsh()) {
698699
return None
699-
}
700700
}
701701

702702
Some(Address {

0 commit comments

Comments
 (0)