Skip to content

Commit

Permalink
clippy: unnecessary vecs
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra committed Aug 8, 2024
1 parent 8894215 commit 97b2229
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/sign_multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn main() {
};

#[rustfmt::skip]
let public_keys = vec![
let public_keys = [
bitcoin::PublicKey::from_slice(&[2; 33]).expect("key 1"),
bitcoin::PublicKey::from_slice(&[
0x02,
Expand Down
2 changes: 1 addition & 1 deletion src/policy/concrete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ fn with_huffman_tree<Pk: MiniscriptKey>(
/// any one of the conditions exclusively.
#[cfg(feature = "compiler")]
fn generate_combination<Pk: MiniscriptKey>(
policy_vec: &Vec<Arc<PolicyArc<Pk>>>,
policy_vec: &[Arc<PolicyArc<Pk>>],
prob: f64,
k: usize,
) -> Vec<(f64, Arc<PolicyArc<Pk>>)> {
Expand Down
1 change: 1 addition & 0 deletions src/psbt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ impl<'psbt, Pk: MiniscriptKey + ToPublicKey> Satisfier<Pk> for PsbtInputSatisfie
}
}

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

0 comments on commit 97b2229

Please sign in to comment.