fix warnings
This commit is contained in:
parent
343b0ccfb9
commit
2b0d8a86a2
@ -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());
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
pub struct TopologicSortIterBuilder<T> {
|
||||
pub(crate) struct TopologicSortIterBuilder<T> {
|
||||
nodes: FxHashMap<T, Entry<T>>,
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ fn get_or_create_entry(&mut self, item: T) -> &mut Entry<T> {
|
||||
self.nodes.entry(item).or_default()
|
||||
}
|
||||
|
||||
pub fn add(&mut self, item: T, predecessors: impl IntoIterator<Item = T>) {
|
||||
pub(crate) fn add(&mut self, item: T, predecessors: impl IntoIterator<Item = T>) {
|
||||
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<Item = T>) {
|
||||
entry.num_predecessors += num_predecessors;
|
||||
}
|
||||
|
||||
pub fn build(self) -> TopologicalSortIter<T> {
|
||||
pub(crate) fn build(self) -> TopologicalSortIter<T> {
|
||||
let ready = self
|
||||
.nodes
|
||||
.iter()
|
||||
@ -43,7 +43,7 @@ pub fn build(self) -> TopologicalSortIter<T> {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TopologicalSortIter<T> {
|
||||
pub(crate) struct TopologicalSortIter<T> {
|
||||
ready: VecDeque<T>,
|
||||
nodes: FxHashMap<T, Entry<T>>,
|
||||
}
|
||||
@ -52,19 +52,19 @@ impl<T> TopologicalSortIter<T>
|
||||
where
|
||||
T: Copy + Eq + PartialEq + Hash,
|
||||
{
|
||||
pub fn builder() -> TopologicSortIterBuilder<T> {
|
||||
pub(crate) fn builder() -> TopologicSortIterBuilder<T> {
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user