Skip to content

Commit 101bcd8

Browse files
committed
Drop a needless match in favor of an if let
1 parent b222be2 commit 101bcd8

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
@@ -1674,15 +1674,12 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, CMH: Deref> P
16741674
},
16751675
Some(peer_lock) => {
16761676
let peer = peer_lock.lock().unwrap();
1677-
match peer.their_node_id {
1678-
Some(node_id) => {
1679-
log_trace!(self.logger,
1680-
"Handling disconnection of peer {}, with {}future connection to the peer possible.",
1681-
log_pubkey!(node_id), if no_connection_possible { "no " } else { "" });
1682-
self.node_id_to_descriptor.lock().unwrap().remove(&node_id);
1683-
self.message_handler.chan_handler.peer_disconnected(&node_id, no_connection_possible);
1684-
},
1685-
None => {}
1677+
if let Some(node_id) = peer.their_node_id {
1678+
log_trace!(self.logger,
1679+
"Handling disconnection of peer {}, with {}future connection to the peer possible.",
1680+
log_pubkey!(node_id), if no_connection_possible { "no " } else { "" });
1681+
self.node_id_to_descriptor.lock().unwrap().remove(&node_id);
1682+
self.message_handler.chan_handler.peer_disconnected(&node_id, no_connection_possible);
16861683
}
16871684
}
16881685
};

0 commit comments

Comments
 (0)