Skip to content

Commit d805c74

Browse files
committed
Auto merge of rust-lang#14064 - WaffleLapkin:simplify_is_exit_check, r=lnicola
minor: Simplify `is_exit` check in `lsp-server` (this is what `socket` one does)
2 parents 577e839 + 41fda76 commit d805c74

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/lsp-server/src/stdio.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ pub(crate) fn stdio_transport() -> (Sender<Message>, Receiver<Message>, IoThread
2121
let stdin = stdin();
2222
let mut stdin = stdin.lock();
2323
while let Some(msg) = Message::read(&mut stdin)? {
24-
let is_exit = match &msg {
25-
Message::Notification(n) => n.is_exit(),
26-
_ => false,
27-
};
24+
let is_exit = matches!(&msg, Message::Notification(n) if n.is_exit());
2825

2926
reader_sender.send(msg).unwrap();
3027

0 commit comments

Comments
 (0)