diff options
author | Lukas Wirth <[email protected]> | 2021-01-12 14:56:24 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-01-12 14:56:24 +0000 |
commit | aff9102afb2b6756b3935dedb9be30401975b262 (patch) | |
tree | 34e38f7297ab93686f270bb03607e9e3590a6597 /crates/ide_db | |
parent | 2c1777a2e264e58fccd5ace94b238c8a497ddbda (diff) |
Rename FileReferences -> UsageSearchResult
Diffstat (limited to 'crates/ide_db')
-rw-r--r-- | crates/ide_db/src/search.rs | 11 |
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)] |
22 | pub struct FileReferences { | 22 | pub struct UsageSearchResult { |
23 | pub references: FxHashMap<FileId, Vec<FileReference>>, | 23 | pub references: FxHashMap<FileId, Vec<FileReference>>, |
24 | } | 24 | } |
25 | 25 | ||
26 | impl FileReferences { | 26 | impl 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 | ||
46 | impl IntoIterator for FileReferences { | 46 | impl 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 |