Skip to content

Commit af2260f

Browse files
committed
Return block directly
Clippy emits: warning: returning the result of a `let` binding from a block As suggested, return the block directly.
1 parent 54412f1 commit af2260f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/miniscript/satisfy.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -833,16 +833,15 @@ impl Satisfaction {
833833
// signatures
834834
let mut sat_indices = (0..subs.len()).collect::<Vec<_>>();
835835
sat_indices.sort_by_key(|&i| {
836-
let stack_weight = match (&sats[i].stack, &ret_stack[i].stack) {
836+
// For malleable satifactions, directly choose smallest weights
837+
match (&sats[i].stack, &ret_stack[i].stack) {
837838
(&Witness::Unavailable, _) | (&Witness::Impossible, _) => i64::MAX,
838839
// This is only possible when one of the branches has PkH
839840
(_, &Witness::Unavailable) | (_, &Witness::Impossible) => i64::MIN,
840841
(&Witness::Stack(ref s), &Witness::Stack(ref d)) => {
841842
witness_size(s) as i64 - witness_size(d) as i64
842843
}
843-
};
844-
// For malleable satifactions, directly choose smallest weights
845-
stack_weight
844+
}
846845
});
847846

848847
// swap the satisfactions

0 commit comments

Comments
 (0)