aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/main_loop.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs
index 17b0b95b9..a8fa2af08 100644
--- a/crates/rust-analyzer/src/main_loop.rs
+++ b/crates/rust-analyzer/src/main_loop.rs
@@ -173,7 +173,6 @@ pub fn main_loop(ws_roots: Vec<PathBuf>, config: Config, connection: Connection)
173 }; 173 };
174 174
175 loop_state.roots_total = world_state.vfs.read().n_roots(); 175 loop_state.roots_total = world_state.vfs.read().n_roots();
176 loop_state.roots_scanned = 0;
177 176
178 let pool = ThreadPool::default(); 177 let pool = ThreadPool::default();
179 let (task_sender, task_receiver) = unbounded::<Task>(); 178 let (task_sender, task_receiver) = unbounded::<Task>();
@@ -400,10 +399,12 @@ fn loop_turn(
400 } 399 }
401 400
402 let max_in_flight_libs = pool.max_count().saturating_sub(2).max(1); 401 let max_in_flight_libs = pool.max_count().saturating_sub(2).max(1);
403 while loop_state.in_flight_libraries < max_in_flight_libs 402 while loop_state.in_flight_libraries < max_in_flight_libs {
404 && !loop_state.pending_libraries.is_empty() 403 let (root, files) = match loop_state.pending_libraries.pop() {
405 { 404 Some(it) => it,
406 let (root, files) = loop_state.pending_libraries.pop().unwrap(); 405 None => break,
406 };
407
407 loop_state.in_flight_libraries += 1; 408 loop_state.in_flight_libraries += 1;
408 let sender = libdata_sender.clone(); 409 let sender = libdata_sender.clone();
409 pool.execute(move || { 410 pool.execute(move || {