From c2d8829d567a6ea19361b27a8711231e6af89844 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 23 Jul 2020 10:26:56 +0200 Subject: minor --- crates/rust-analyzer/src/main_loop.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index f6d8daeed..ac95e428e 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs @@ -97,22 +97,6 @@ impl fmt::Debug for Event { } impl GlobalState { - fn next_event(&self, inbox: &Receiver) -> Option { - select! { - recv(inbox) -> msg => - msg.ok().map(Event::Lsp), - - recv(self.task_pool.receiver) -> task => - Some(Event::Task(task.unwrap())), - - recv(self.loader.receiver) -> task => - Some(Event::Vfs(task.unwrap())), - - recv(self.flycheck_receiver) -> task => - Some(Event::Flycheck(task.unwrap())), - } - } - fn run(mut self, inbox: Receiver) -> Result<()> { if self.config.linked_projects.is_empty() && self.config.notifications.cargo_toml_not_found { @@ -169,6 +153,22 @@ impl GlobalState { Err("client exited without proper shutdown sequence")? } + fn next_event(&self, inbox: &Receiver) -> Option { + select! { + recv(inbox) -> msg => + msg.ok().map(Event::Lsp), + + recv(self.task_pool.receiver) -> task => + Some(Event::Task(task.unwrap())), + + recv(self.loader.receiver) -> task => + Some(Event::Vfs(task.unwrap())), + + recv(self.flycheck_receiver) -> task => + Some(Event::Flycheck(task.unwrap())), + } + } + fn handle_event(&mut self, event: Event) -> Result<()> { let loop_start = Instant::now(); // NOTE: don't count blocking select! call as a loop-turn time -- cgit v1.2.3