Skip to content

Commit

Permalink
Accept slice instead of vec
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharding committed Feb 1, 2024
1 parent 66abe2c commit f46a4d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/v0/miniscript/satisfy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl<'a, Pk: MiniscriptKey + ToPublicKey> Satisfier<Pk> for PsbtInputSatisfier<'
}
}

fn try_vec_as_preimage32(vec: &Vec<u8>) -> Option<Preimage32> {
fn try_vec_as_preimage32(vec: &[u8]>) -> Option<Preimage32> {
if vec.len() == 32 {
let mut arr = [0u8; 32];
arr.copy_from_slice(vec);
Expand Down
2 changes: 1 addition & 1 deletion src/v2/miniscript/satisfy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl<'a, Pk: MiniscriptKey + ToPublicKey> Satisfier<Pk> for InputSatisfier<'a> {
}
}

fn try_vec_as_preimage32(vec: &Vec<u8>) -> Option<Preimage32> {
fn try_vec_as_preimage32(vec: &[u8]>) -> Option<Preimage32> {
if vec.len() == 32 {
let mut arr = [0u8; 32];
arr.copy_from_slice(vec);
Expand Down

0 comments on commit f46a4d2

Please sign in to comment.