Skip to content

Commit d73cbf2

Browse files
committed
Drop a needless match in favor of an if let
1 parent 3d0bb59 commit d73cbf2

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

lightning/src/ln/peer_handler.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,15 +1670,12 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, CMH: Deref> P
16701670
},
16711671
Some(peer_lock) => {
16721672
let peer = peer_lock.lock().unwrap();
1673-
match peer.their_node_id {
1674-
Some(node_id) => {
1675-
log_trace!(self.logger,
1676-
"Handling disconnection of peer {}, with {}future connection to the peer possible.",
1677-
log_pubkey!(node_id), if no_connection_possible { "no " } else { "" });
1678-
self.node_id_to_descriptor.lock().unwrap().remove(&node_id);
1679-
self.message_handler.chan_handler.peer_disconnected(&node_id, no_connection_possible);
1680-
},
1681-
None => {}
1673+
if let Some(node_id) = peer.their_node_id {
1674+
log_trace!(self.logger,
1675+
"Handling disconnection of peer {}, with {}future connection to the peer possible.",
1676+
log_pubkey!(node_id), if no_connection_possible { "no " } else { "" });
1677+
self.node_id_to_descriptor.lock().unwrap().remove(&node_id);
1678+
self.message_handler.chan_handler.peer_disconnected(&node_id, no_connection_possible);
16821679
}
16831680
}
16841681
};

0 commit comments

Comments
 (0)