Skip to content

Commit 97b2229

Browse files
committed
clippy: unnecessary vecs
1 parent 8894215 commit 97b2229

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

examples/sign_multisig.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn main() {
4747
};
4848

4949
#[rustfmt::skip]
50-
let public_keys = vec![
50+
let public_keys = [
5151
bitcoin::PublicKey::from_slice(&[2; 33]).expect("key 1"),
5252
bitcoin::PublicKey::from_slice(&[
5353
0x02,

src/policy/concrete.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ fn with_huffman_tree<Pk: MiniscriptKey>(
12641264
/// any one of the conditions exclusively.
12651265
#[cfg(feature = "compiler")]
12661266
fn generate_combination<Pk: MiniscriptKey>(
1267-
policy_vec: &Vec<Arc<PolicyArc<Pk>>>,
1267+
policy_vec: &[Arc<PolicyArc<Pk>>],
12681268
prob: f64,
12691269
k: usize,
12701270
) -> Vec<(f64, Arc<PolicyArc<Pk>>)> {

src/psbt/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ impl<'psbt, Pk: MiniscriptKey + ToPublicKey> Satisfier<Pk> for PsbtInputSatisfie
443443
}
444444
}
445445

446+
#[allow(clippy::ptr_arg)] // complains about &Vec but this is used in a closure context
446447
fn try_vec_as_preimage32(vec: &Vec<u8>) -> Option<Preimage32> {
447448
if vec.len() == 32 {
448449
let mut arr = [0u8; 32];

0 commit comments

Comments
 (0)