Skip to content

Commit 2b0d8a8

Browse files
committed
fix warnings
1 parent 343b0cc commit 2b0d8a8

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

crates/ide/src/prime_caches.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mod topologic_sort;
77
use hir::db::DefDatabase;
88
use ide_db::base_db::{
99
salsa::{Database, ParallelDatabase, Snapshot},
10-
Cancelled, CrateGraph, CrateId, SourceDatabase, SourceDatabaseExt,
10+
CrateGraph, CrateId, SourceDatabase, SourceDatabaseExt,
1111
};
1212
use rustc_hash::{FxHashMap, FxHashSet};
1313

@@ -104,7 +104,6 @@ where
104104

105105
let crates_total = crates_to_prime.len();
106106
let mut crates_done = 0;
107-
108107
let mut crates_currently_indexing =
109108
FxHashMap::with_capacity_and_hasher(num_worker_threads as _, Default::default());
110109

crates/ide/src/prime_caches/topologic_sort.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::{collections::VecDeque, hash::Hash};
22

33
use rustc_hash::FxHashMap;
44

5-
pub struct TopologicSortIterBuilder<T> {
5+
pub(crate) struct TopologicSortIterBuilder<T> {
66
nodes: FxHashMap<T, Entry<T>>,
77
}
88

@@ -18,7 +18,7 @@ where
1818
self.nodes.entry(item).or_default()
1919
}
2020

21-
pub fn add(&mut self, item: T, predecessors: impl IntoIterator<Item = T>) {
21+
pub(crate) fn add(&mut self, item: T, predecessors: impl IntoIterator<Item = T>) {
2222
let mut num_predecessors = 0;
2323

2424
for predecessor in predecessors.into_iter() {
@@ -30,7 +30,7 @@ where
3030
entry.num_predecessors += num_predecessors;
3131
}
3232

33-
pub fn build(self) -> TopologicalSortIter<T> {
33+
pub(crate) fn build(self) -> TopologicalSortIter<T> {
3434
let ready = self
3535
.nodes
3636
.iter()
@@ -43,7 +43,7 @@ where
4343
}
4444
}
4545

46-
pub struct TopologicalSortIter<T> {
46+
pub(crate) struct TopologicalSortIter<T> {
4747
ready: VecDeque<T>,
4848
nodes: FxHashMap<T, Entry<T>>,
4949
}
@@ -52,19 +52,19 @@ impl<T> TopologicalSortIter<T>
5252
where
5353
T: Copy + Eq + PartialEq + Hash,
5454
{
55-
pub fn builder() -> TopologicSortIterBuilder<T> {
55+
pub(crate) fn builder() -> TopologicSortIterBuilder<T> {
5656
TopologicSortIterBuilder::new()
5757
}
5858

59-
pub fn len(&self) -> usize {
59+
pub(crate) fn len(&self) -> usize {
6060
self.nodes.len()
6161
}
6262

63-
pub fn is_empty(&self) -> bool {
63+
pub(crate) fn is_empty(&self) -> bool {
6464
self.len() == 0
6565
}
6666

67-
pub fn mark_done(&mut self, item: T) {
67+
pub(crate) fn mark_done(&mut self, item: T) {
6868
let entry = self.nodes.remove(&item).expect("invariant: unknown item marked as done");
6969

7070
for successor in entry.successors {

0 commit comments

Comments
 (0)