Skip to content

Commit 552d8e4

Browse files
Make LSPSDateTime Copy rather than explicitely _clone_ing
1 parent 42243e8 commit 552d8e4

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

lightning-liquidity/src/lsps0/ser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl wire::Type for RawLSPSMessage {
218218
pub struct LSPSRequestId(pub String);
219219

220220
/// An object representing datetimes as described in bLIP-50 / LSPS0.
221-
#[derive(Clone, Debug, PartialEq, Eq, Hash, Deserialize, Serialize)]
221+
#[derive(Clone, Debug, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
222222
#[serde(transparent)]
223223
pub struct LSPSDateTime(pub chrono::DateTime<chrono::Utc>);
224224

lightning-liquidity/src/lsps1/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ where
266266
let order_id = self.generate_order_id();
267267
let channel = OutboundCRChannel::new(
268268
params.order.clone(),
269-
created_at.clone(),
269+
created_at,
270270
order_id.clone(),
271271
payment.clone(),
272272
);

lightning-liquidity/src/lsps2/msgs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl LSPS2RawOpeningFeeParams {
7272
LSPS2OpeningFeeParams {
7373
min_fee_msat: self.min_fee_msat,
7474
proportional: self.proportional,
75-
valid_until: self.valid_until.clone(),
75+
valid_until: self.valid_until,
7676
min_lifetime: self.min_lifetime,
7777
max_client_to_self_delay: self.max_client_to_self_delay,
7878
min_payment_size_msat: self.min_payment_size_msat,
@@ -235,7 +235,7 @@ mod tests {
235235
let raw = LSPS2RawOpeningFeeParams {
236236
min_fee_msat,
237237
proportional,
238-
valid_until: valid_until.clone().into(),
238+
valid_until: valid_until.into(),
239239
min_lifetime,
240240
max_client_to_self_delay,
241241
min_payment_size_msat,

lightning-liquidity/src/lsps5/service.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ where
185185
Entry::Occupied(mut entry) => {
186186
no_change = entry.get().url == params.webhook;
187187
let (last_used, last_notification_sent) = if no_change {
188-
(entry.get().last_used.clone(), entry.get().last_notification_sent.clone())
188+
(entry.get().last_used, entry.get().last_notification_sent.clone())
189189
} else {
190190
(now, new_hash_map())
191191
};
@@ -438,8 +438,8 @@ where
438438
}
439439

440440
for (app_name, webhook) in client_webhooks.iter_mut() {
441-
webhook.last_notification_sent.insert(notification.method.clone(), now.clone());
442-
webhook.last_used = now.clone();
441+
webhook.last_notification_sent.insert(notification.method.clone(), now);
442+
webhook.last_used = now;
443443
self.send_notification(
444444
client_id,
445445
app_name.clone(),

0 commit comments

Comments
 (0)