Skip to content

Commit 4e27a3c

Browse files
committed
f Impl Copy on new types
1 parent fcee7b8 commit 4e27a3c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/test/functional_tests.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,12 @@ fn channel_full_cycle() {
7676

7777
expect_event!(node_a, ChannelReady);
7878

79-
let channel_id = match node_b.next_event() {
79+
let ev = node_b.next_event();
80+
let channel_id = match ev {
8081
ref e @ Event::ChannelReady { ref channel_id, .. } => {
8182
println!("{} got event {:?}", std::stringify!(node_b), e);
8283
node_b.event_handled();
83-
channel_id.clone()
84+
channel_id
8485
}
8586
ref e => {
8687
panic!("{} got unexpected event!: {:?}", std::stringify!(node_b), e);

src/types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl UniffiCustomTypeConverter for PaymentSecret {
202202
/// Note that this will start out to be a temporary ID until channel funding negotiation is
203203
/// finalized, at which point it will change to be a permanent global ID tied to the on-chain
204204
/// funding transaction.
205-
#[derive(Debug, Clone, PartialEq, Eq)]
205+
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
206206
pub struct ChannelId(pub [u8; 32]);
207207

208208
impl UniffiCustomTypeConverter for ChannelId {
@@ -241,7 +241,7 @@ impl Readable for ChannelId {
241241
/// A local, potentially user-provided, identifier of a channel.
242242
///
243243
/// By default, this will be randomly generated for the user to ensure local uniqueness.
244-
#[derive(Debug, Clone, PartialEq, Eq)]
244+
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
245245
pub struct UserChannelId(pub u128);
246246

247247
impl UniffiCustomTypeConverter for UserChannelId {
@@ -270,7 +270,7 @@ impl Readable for UserChannelId {
270270
}
271271
}
272272

273-
#[derive(PartialEq, Eq, Debug, Clone)]
273+
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
274274
pub struct Network(pub bitcoin::Network);
275275

276276
impl Default for Network {

0 commit comments

Comments
 (0)