diff --git a/crates/ide/src/prime_caches.rs b/crates/ide/src/prime_caches.rs index 6464d599f08..f5bf6de2144 100644 --- a/crates/ide/src/prime_caches.rs +++ b/crates/ide/src/prime_caches.rs @@ -7,7 +7,7 @@ use hir::db::DefDatabase; use ide_db::base_db::{ salsa::{Database, ParallelDatabase, Snapshot}, - Cancelled, CrateGraph, CrateId, SourceDatabase, SourceDatabaseExt, + CrateGraph, CrateId, SourceDatabase, SourceDatabaseExt, }; use rustc_hash::{FxHashMap, FxHashSet}; @@ -104,7 +104,6 @@ enum ParallelPrimeCacheWorkerProgress { let crates_total = crates_to_prime.len(); let mut crates_done = 0; - let mut crates_currently_indexing = FxHashMap::with_capacity_and_hasher(num_worker_threads as _, Default::default()); diff --git a/crates/ide/src/prime_caches/topologic_sort.rs b/crates/ide/src/prime_caches/topologic_sort.rs index f89f84bc5b5..859c454283b 100644 --- a/crates/ide/src/prime_caches/topologic_sort.rs +++ b/crates/ide/src/prime_caches/topologic_sort.rs @@ -2,7 +2,7 @@ use rustc_hash::FxHashMap; -pub struct TopologicSortIterBuilder { +pub(crate) struct TopologicSortIterBuilder { nodes: FxHashMap>, } @@ -18,7 +18,7 @@ fn get_or_create_entry(&mut self, item: T) -> &mut Entry { self.nodes.entry(item).or_default() } - pub fn add(&mut self, item: T, predecessors: impl IntoIterator) { + pub(crate) fn add(&mut self, item: T, predecessors: impl IntoIterator) { let mut num_predecessors = 0; for predecessor in predecessors.into_iter() { @@ -30,7 +30,7 @@ pub fn add(&mut self, item: T, predecessors: impl IntoIterator) { entry.num_predecessors += num_predecessors; } - pub fn build(self) -> TopologicalSortIter { + pub(crate) fn build(self) -> TopologicalSortIter { let ready = self .nodes .iter() @@ -43,7 +43,7 @@ pub fn build(self) -> TopologicalSortIter { } } -pub struct TopologicalSortIter { +pub(crate) struct TopologicalSortIter { ready: VecDeque, nodes: FxHashMap>, } @@ -52,19 +52,19 @@ impl TopologicalSortIter where T: Copy + Eq + PartialEq + Hash, { - pub fn builder() -> TopologicSortIterBuilder { + pub(crate) fn builder() -> TopologicSortIterBuilder { TopologicSortIterBuilder::new() } - pub fn len(&self) -> usize { + pub(crate) fn len(&self) -> usize { self.nodes.len() } - pub fn is_empty(&self) -> bool { + pub(crate) fn is_empty(&self) -> bool { self.len() == 0 } - pub fn mark_done(&mut self, item: T) { + pub(crate) fn mark_done(&mut self, item: T) { let entry = self.nodes.remove(&item).expect("invariant: unknown item marked as done"); for successor in entry.successors {