Skip to content

Commit d3d1f49

Browse files
committed
f Don't take by reference if we'd need to clone
1 parent 9118a49 commit d3d1f49

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
//!
4848
//! let node_id = PublicKey::from_str("NODE_ID").unwrap();
4949
//! let node_addr = "IP_ADDR:PORT".parse().unwrap();
50-
//! node.connect_open_channel(&node_id, &node_addr, 10000, false).unwrap();
50+
//! node.connect_open_channel(node_id, node_addr, 10000, false).unwrap();
5151
//!
5252
//! let invoice = Invoice::from_str("INVOICE_STR").unwrap();
5353
//! node.send_payment(&invoice).unwrap();
@@ -847,7 +847,7 @@ impl Node {
847847
///
848848
/// Returns a temporary channel id
849849
pub fn connect_open_channel(
850-
&self, node_id: &PublicKey, address: &SocketAddr, channel_amount_sats: u64,
850+
&self, node_id: PublicKey, address: SocketAddr, channel_amount_sats: u64,
851851
announce_channel: bool,
852852
) -> Result<(), Error> {
853853
let runtime_lock = self.running.read().unwrap();
@@ -863,7 +863,7 @@ impl Node {
863863
return Err(Error::InsufficientFunds);
864864
}
865865

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

868868
let con_peer_pubkey = peer_info.pubkey.clone();
869869
let con_peer_addr = peer_info.address.clone();

src/test/functional_tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fn channel_full_cycle() {
3333

3434
println!("\nA -- connect_open_channel -> B");
3535
node_a
36-
.connect_open_channel(&node_b.node_id(), &node_b.listening_address().unwrap(), 50000, true)
36+
.connect_open_channel(node_b.node_id(), *node_b.listening_address().unwrap(), 50000, true)
3737
.unwrap();
3838

3939
expect_event!(node_a, ChannelPending);
@@ -217,8 +217,8 @@ fn channel_open_fails_when_funds_insufficient() {
217217
assert_eq!(
218218
Err(Error::InsufficientFunds),
219219
node_a.connect_open_channel(
220-
&node_b.node_id(),
221-
&node_b.listening_address().unwrap(),
220+
node_b.node_id(),
221+
*node_b.listening_address().unwrap(),
222222
120000,
223223
true
224224
)

0 commit comments

Comments
 (0)