Skip to content

Commit 2bc083e

Browse files
committed
Use iterator instead of manual loop
Get more Rusty, use iterator instead of array access. While we are at it don't explicitly create the slice, that is a hangover from Rust 1.48
1 parent 6d663e1 commit 2bc083e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/taproot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ fn hardcoded_xonlypubkeys() -> Vec<XOnlyPublicKey> {
136136
],
137137
];
138138
let mut keys: Vec<XOnlyPublicKey> = vec![];
139-
for idx in 0..4 {
140-
keys.push(XOnlyPublicKey::from_slice(&serialized_keys[idx][..]).unwrap());
139+
for key in serialized_keys {
140+
keys.push(XOnlyPublicKey::from_slice(&key).unwrap());
141141
}
142142
keys
143143
}

0 commit comments

Comments
 (0)