aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_db/src')
-rw-r--r--crates/ide_db/src/search.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/ide_db/src/search.rs b/crates/ide_db/src/search.rs
index 89a313e9b..b5fa46642 100644
--- a/crates/ide_db/src/search.rs
+++ b/crates/ide_db/src/search.rs
@@ -19,11 +19,11 @@ use crate::{
19}; 19};
20 20
21#[derive(Debug, Default, Clone)] 21#[derive(Debug, Default, Clone)]
22pub struct FileReferences { 22pub struct UsageSearchResult {
23 pub references: FxHashMap<FileId, Vec<FileReference>>, 23 pub references: FxHashMap<FileId, Vec<FileReference>>,
24} 24}
25 25
26impl FileReferences { 26impl UsageSearchResult {
27 pub fn is_empty(&self) -> bool { 27 pub fn is_empty(&self) -> bool {
28 self.references.is_empty() 28 self.references.is_empty()
29 } 29 }
@@ -43,7 +43,7 @@ impl FileReferences {
43 } 43 }
44} 44}
45 45
46impl IntoIterator for FileReferences { 46impl IntoIterator for UsageSearchResult {
47 type Item = (FileId, Vec<FileReference>); 47 type Item = (FileId, Vec<FileReference>);
48 type IntoIter = <FxHashMap<FileId, Vec<FileReference>> as IntoIterator>::IntoIter; 48 type IntoIter = <FxHashMap<FileId, Vec<FileReference>> as IntoIterator>::IntoIter;
49 49
@@ -293,9 +293,8 @@ impl<'a> FindUsages<'a> {
293 found 293 found
294 } 294 }
295 295
296 /// The [`FileReferences`] returned always have unique [`FileId`]s. 296 pub fn all(self) -> UsageSearchResult {
297 pub fn all(self) -> FileReferences { 297 let mut res = UsageSearchResult::default();
298 let mut res = FileReferences::default();
299 self.search(&mut |file_id, reference| { 298 self.search(&mut |file_id, reference| {
300 res.references.entry(file_id).or_default().push(reference); 299 res.references.entry(file_id).or_default().push(reference);
301 false 300 false