Skip to content

Commit

Permalink
Remove clone() calls on PublicKey for using to_protobuf_encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Jul 18, 2021
1 parent 2f3e235 commit cd0523d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/peer_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl PeerId {
pub fn is_public_key(&self, public_key: &PublicKey) -> Option<bool> {
let alg = Code::try_from(self.multihash.code())
.expect("Internal multihash is always a valid `Code`");
let enc = public_key.clone().to_protobuf_encoding();
let enc = public_key.to_protobuf_encoding();
Some(alg.digest(&enc) == self.multihash)
}
}
Expand Down
2 changes: 1 addition & 1 deletion transports/noise/src/io/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ where
let mut pb = payload_proto::NoiseHandshakePayload::default();

if state.send_identity {
pb.identity_key = state.identity.public.clone().to_protobuf_encoding()
pb.identity_key = state.identity.public.to_protobuf_encoding()
}

if let Some(ref sig) = state.identity.signature {
Expand Down

0 comments on commit cd0523d

Please sign in to comment.