Skip to content

Commit 141a645

Browse files
committed
Fix a clippy::collapsible_match lint
We don't use the suggestion here, because it's actually wrong. See rust-lang/rust-clippy#7575
1 parent f35f9b0 commit 141a645

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

zebra-consensus/src/transaction/tests.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,15 @@ fn v5_fake_transactions() -> Result<(), Report> {
4444
check::coinbase_tx_no_prevout_joinsplit_spend(&transaction)?;
4545

4646
// validate the sapling shielded data
47-
match transaction {
48-
Transaction::V5 {
49-
sapling_shielded_data,
50-
..
51-
} => {
52-
if let Some(s) = sapling_shielded_data {
53-
for spend in s.spends_per_anchor() {
54-
check::spend_cv_rk_not_small_order(&spend)?
55-
}
56-
for output in s.outputs() {
57-
check::output_cv_epk_not_small_order(output)?;
58-
}
59-
}
47+
if transaction.version() == 5 {
48+
for spend in transaction.sapling_spends_per_anchor() {
49+
check::spend_cv_rk_not_small_order(&spend)?;
6050
}
61-
_ => panic!("we should have no tx other than 5"),
51+
for output in transaction.sapling_outputs() {
52+
check::output_cv_epk_not_small_order(output)?;
53+
}
54+
} else {
55+
panic!("we should have no tx other than 5");
6256
}
6357
}
6458
}

0 commit comments

Comments
 (0)