From 41fda7615244349076e7cfe07b7b742acbe8e647 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Tue, 31 Jan 2023 11:01:01 +0000 Subject: [PATCH] simplify `is_exit` check --- lib/lsp-server/src/stdio.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/lsp-server/src/stdio.rs b/lib/lsp-server/src/stdio.rs index cdee6432df8..49a825e579b 100644 --- a/lib/lsp-server/src/stdio.rs +++ b/lib/lsp-server/src/stdio.rs @@ -21,10 +21,7 @@ pub(crate) fn stdio_transport() -> (Sender, Receiver, IoThread let stdin = stdin(); let mut stdin = stdin.lock(); while let Some(msg) = Message::read(&mut stdin)? { - let is_exit = match &msg { - Message::Notification(n) => n.is_exit(), - _ => false, - }; + let is_exit = matches!(&msg, Message::Notification(n) if n.is_exit()); reader_sender.send(msg).unwrap();