Skip to content

Commit 669a065

Browse files
Make LSPSDateTime Copy rather than explicitely _clone_ing
1 parent 497a89b commit 669a065

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
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/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)