Skip to content

Commit

Permalink
chore: fix clone nits
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Jan 16, 2024
1 parent 49e64b0 commit 7838d02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions near-sdk/src/promise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ mod tests {
}

fn has_add_key_with_full_access(public_key: PublicKey, nonce: Option<u64>) -> bool {
let public_key = near_crypto::PublicKey::try_from(public_key.clone()).unwrap();
let public_key = near_crypto::PublicKey::try_from(public_key).unwrap();
get_actions().any(|el| {
matches!(
el,
Expand All @@ -656,7 +656,7 @@ mod tests {
function_names: String,
nonce: Option<u64>,
) -> bool {
let public_key = near_crypto::PublicKey::try_from(public_key.clone()).unwrap();
let public_key = near_crypto::PublicKey::try_from(public_key).unwrap();
get_actions().any(|el| {
matches!(
el,
Expand Down Expand Up @@ -834,7 +834,7 @@ mod tests {
.add_full_access_key(public_key.clone())
.delete_key(public_key.clone());
}
let public_key = near_crypto::PublicKey::try_from(public_key.clone()).unwrap();
let public_key = near_crypto::PublicKey::try_from(public_key).unwrap();

let has_action = get_actions().any(|el| {
matches!(
Expand Down
2 changes: 1 addition & 1 deletion near-sdk/src/types/public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl TryFrom<PublicKey> for near_crypto::PublicKey {
let curve_type = CurveType::from_u8(public_key.data[0])?;
let expected_len = curve_type.data_len();

let key_bytes = public_key.clone().into_bytes();
let key_bytes = public_key.into_bytes();
if key_bytes.len() != expected_len + 1 {
return Err(ParsePublicKeyError {
kind: ParsePublicKeyErrorKind::InvalidLength(key_bytes.len()),
Expand Down

0 comments on commit 7838d02

Please sign in to comment.