Skip to content

Commit

Permalink
f Don't take a ref if we need to clone
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed Apr 25, 2023
1 parent 882bf8b commit ef1f8ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ impl Node {
///
/// If `permanently` is set to `true`, we'll remember the peer and reconnect to it on restart.
pub fn connect(
&self, node_id: &PublicKey, address: &SocketAddr, permanently: bool,
&self, node_id: PublicKey, address: SocketAddr, permanently: bool,
) -> Result<(), Error> {
let runtime_lock = self.running.read().unwrap();
if runtime_lock.is_none() {
Expand All @@ -856,7 +856,7 @@ impl Node {

let runtime = runtime_lock.as_ref().unwrap();

let peer_info = PeerInfo { pubkey: node_id.clone(), address: address.clone() };
let peer_info = PeerInfo { pubkey: node_id, address };

let con_peer_pubkey = peer_info.pubkey.clone();
let con_peer_addr = peer_info.address.clone();
Expand Down

0 comments on commit ef1f8ff

Please sign in to comment.