Skip to content

Commit b339010

Browse files
committed
clippy: fix many_single_char_names lint
Just one test. Arguably I should've just whitelisted it. BUt I cleaned it up.
1 parent 90c4f38 commit b339010

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

src/taproot.rs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -951,21 +951,24 @@ mod tests{
951951
// / \ / \
952952
// A B C / \
953953
// D E
954-
let a = Script::from_hex("51").unwrap();
955-
let b = Script::from_hex("52").unwrap();
956-
let c = Script::from_hex("53").unwrap();
957-
let d = Script::from_hex("54").unwrap();
958-
let e = Script::from_hex("55").unwrap();
959-
let builder = builder.add_leaf(2, a.clone()).unwrap();
960-
let builder = builder.add_leaf(2, b.clone()).unwrap();
961-
let builder = builder.add_leaf(2, c.clone()).unwrap();
962-
let builder = builder.add_leaf(3, d.clone()).unwrap();
963-
let builder = builder.add_leaf(3, e.clone()).unwrap();
954+
let scripts = [
955+
Script::from_hex("51").unwrap(),
956+
Script::from_hex("52").unwrap(),
957+
Script::from_hex("53").unwrap(),
958+
Script::from_hex("54").unwrap(),
959+
Script::from_hex("55").unwrap(),
960+
];
961+
let builder = builder
962+
.add_leaf(2, scripts[0].clone()).unwrap()
963+
.add_leaf(2, scripts[1].clone()).unwrap()
964+
.add_leaf(2, scripts[2].clone()).unwrap()
965+
.add_leaf(3, scripts[3].clone()).unwrap()
966+
.add_leaf(3, scripts[4].clone()).unwrap();
964967

965968
let tree_info = builder.finalize(&secp, internal_key).unwrap();
966969
let output_key = tree_info.output_key();
967970

968-
for script in [a, b, c, d, e] {
971+
for script in scripts {
969972
let ver_script = (script, LeafVersion::default());
970973
let ctrl_block = tree_info.control_block(&ver_script).unwrap();
971974
assert!(ctrl_block.verify_taproot_commitment(&secp, &output_key, &ver_script.0))

0 commit comments

Comments
 (0)