Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/base-db/src/lib.rs')
-rw-r--r--crates/base-db/src/lib.rs25
1 files changed, 6 insertions, 19 deletions
diff --git a/crates/base-db/src/lib.rs b/crates/base-db/src/lib.rs
index 7593135c5c..b65cf7341f 100644
--- a/crates/base-db/src/lib.rs
+++ b/crates/base-db/src/lib.rs
@@ -6,10 +6,9 @@ mod input;
mod change;
pub mod fixture;
-use std::{hash::BuildHasherDefault, panic, sync::Arc};
+use std::{panic, sync::Arc};
-use indexmap::IndexSet;
-use rustc_hash::FxHasher;
+use rustc_hash::FxHashSet;
use syntax::{ast, Parse, SourceFile, TextRange, TextSize};
pub use crate::{
@@ -60,10 +59,7 @@ pub trait FileLoader {
/// Text of the file.
fn file_text(&self, file_id: FileId) -> Arc<str>;
fn resolve_path(&self, path: AnchoredPath<'_>) -> Option<FileId>;
- fn relevant_crates(
- &self,
- file_id: FileId,
- ) -> Arc<IndexSet<CrateId, BuildHasherDefault<FxHasher>>>;
+ fn relevant_crates(&self, file_id: FileId) -> Arc<FxHashSet<CrateId>>;
}
/// Database which stores all significant input facts: source code and project
@@ -103,16 +99,10 @@ pub trait SourceDatabaseExt: SourceDatabase {
#[salsa::input]
fn source_root(&self, id: SourceRootId) -> Arc<SourceRoot>;
- fn source_root_crates(
- &self,
- id: SourceRootId,
- ) -> Arc<IndexSet<CrateId, BuildHasherDefault<FxHasher>>>;
+ fn source_root_crates(&self, id: SourceRootId) -> Arc<FxHashSet<CrateId>>;
}
-fn source_root_crates(
- db: &dyn SourceDatabaseExt,
- id: SourceRootId,
-) -> Arc<IndexSet<CrateId, BuildHasherDefault<FxHasher>>> {
+fn source_root_crates(db: &dyn SourceDatabaseExt, id: SourceRootId) -> Arc<FxHashSet<CrateId>> {
let graph = db.crate_graph();
let res = graph
.iter()
@@ -138,10 +128,7 @@ impl<T: SourceDatabaseExt> FileLoader for FileLoaderDelegate<&'_ T> {
source_root.resolve_path(path)
}
- fn relevant_crates(
- &self,
- file_id: FileId,
- ) -> Arc<IndexSet<CrateId, BuildHasherDefault<FxHasher>>> {
+ fn relevant_crates(&self, file_id: FileId) -> Arc<FxHashSet<CrateId>> {
let _p = profile::span("relevant_crates");
let source_root = self.0.file_source_root(file_id);
self.0.source_root_crates(source_root)