From e21bf1b2b91041be601d22c3415daf9bcb7246a8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 2 Apr 2020 12:50:34 +0200 Subject: Siplify --- crates/rust-analyzer/src/config.rs | 1 - crates/rust-analyzer/src/main_loop.rs | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 15aab7f09..07fb8f16a 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -18,7 +18,6 @@ pub struct Config { pub client_caps: ClientCapsConfig, pub with_sysroot: bool, - // TODO: verify that it means what I think it means pub publish_diagnostics: bool, // TODO: move to experimental capabilities pub vscode_lldb: bool, diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 36ea85cc6..95e676e0f 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs @@ -889,10 +889,9 @@ fn update_file_notifications_on_threadpool( subscriptions: Vec, ) { log::trace!("updating notifications for {:?}", subscriptions); - let publish_diagnostics = world.config.publish_diagnostics; - pool.execute(move || { - for file_id in subscriptions { - if publish_diagnostics { + if world.config.publish_diagnostics { + pool.execute(move || { + for file_id in subscriptions { match handlers::publish_diagnostics(&world, file_id) { Err(e) => { if !is_canceled(&e) { @@ -904,8 +903,8 @@ fn update_file_notifications_on_threadpool( } } } - } - }); + }) + } } pub fn show_message(typ: req::MessageType, message: impl Into, sender: &Sender) { -- cgit v1.2.3