Skip to content

Commit 9d1fba8

Browse files
committed
f Don't take a ref if we need to clone
1 parent b1d9b8c commit 9d1fba8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ impl Node {
847847
///
848848
/// If `permanently` is set to `true`, we'll remember the peer and reconnect to it on restart.
849849
pub fn connect(
850-
&self, node_id: &PublicKey, address: &SocketAddr, permanently: bool,
850+
&self, node_id: PublicKey, address: SocketAddr, permanently: bool,
851851
) -> Result<(), Error> {
852852
let runtime_lock = self.running.read().unwrap();
853853
if runtime_lock.is_none() {
@@ -856,7 +856,7 @@ impl Node {
856856

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

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

861861
let con_peer_pubkey = peer_info.pubkey.clone();
862862
let con_peer_addr = peer_info.address.clone();

0 commit comments

Comments
 (0)