Skip to content

Commit 56d1c3f

Browse files
committed
Fix map_err lint
Use inspect_err where map_err is unnecessary.
1 parent 23109b6 commit 56d1c3f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4137,10 +4137,9 @@ where
41374137
let (onion_packet, htlc_msat, htlc_cltv) = onion_utils::create_payment_onion(
41384138
&self.secp_ctx, &path, &session_priv, total_value, recipient_onion, cur_height,
41394139
payment_hash, keysend_preimage, prng_seed
4140-
).map_err(|e| {
4140+
).inspect_err(|e| {
41414141
let logger = WithContext::from(&self.logger, Some(path.hops.first().unwrap().pubkey), None, Some(*payment_hash));
41424142
log_error!(logger, "Failed to build an onion for path for payment hash {}", payment_hash);
4143-
e
41444143
})?;
41454144

41464145
let err: Result<(), _> = loop {

lightning/src/ln/outbound_payment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ impl OutboundPayments {
770770
let onion_session_privs = self.add_new_pending_payment(payment_hash, recipient_onion.clone(), payment_id, None, route, None, None, entropy_source, best_block_height)?;
771771
self.pay_route_internal(route, payment_hash, &recipient_onion, None, payment_id, None,
772772
onion_session_privs, node_signer, best_block_height, &send_payment_along_path)
773-
.map_err(|e| { self.remove_outbound_if_all_failed(payment_id, &e); e })
773+
.inspect_err(|e| { self.remove_outbound_if_all_failed(payment_id, &e); })
774774
}
775775

776776
pub(super) fn send_spontaneous_payment<R: Deref, ES: Deref, NS: Deref, IH, SP, L: Deref>(

0 commit comments

Comments
 (0)