From: Matt Corallo Date: Mon, 11 Apr 2022 17:34:11 +0000 (+0000) Subject: Drop a needless match in favor of an `if let` X-Git-Tag: v0.0.107~31^2~3 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=101bcd8da5af5d9df294dc92b694d731c262020c;p=rust-lightning Drop a needless match in favor of an `if let` --- diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs index 08bfa919d..d4e6b4645 100644 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@ -1674,15 +1674,12 @@ impl P }, Some(peer_lock) => { let peer = peer_lock.lock().unwrap(); - match peer.their_node_id { - Some(node_id) => { - log_trace!(self.logger, - "Handling disconnection of peer {}, with {}future connection to the peer possible.", - log_pubkey!(node_id), if no_connection_possible { "no " } else { "" }); - self.node_id_to_descriptor.lock().unwrap().remove(&node_id); - self.message_handler.chan_handler.peer_disconnected(&node_id, no_connection_possible); - }, - None => {} + if let Some(node_id) = peer.their_node_id { + log_trace!(self.logger, + "Handling disconnection of peer {}, with {}future connection to the peer possible.", + log_pubkey!(node_id), if no_connection_possible { "no " } else { "" }); + self.node_id_to_descriptor.lock().unwrap().remove(&node_id); + self.message_handler.chan_handler.peer_disconnected(&node_id, no_connection_possible); } } };