From aff9102afb2b6756b3935dedb9be30401975b262 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 12 Jan 2021 15:56:24 +0100 Subject: Rename FileReferences -> UsageSearchResult --- crates/ide_db/src/search.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'crates/ide_db') 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::{ }; #[derive(Debug, Default, Clone)] -pub struct FileReferences { +pub struct UsageSearchResult { pub references: FxHashMap>, } -impl FileReferences { +impl UsageSearchResult { pub fn is_empty(&self) -> bool { self.references.is_empty() } @@ -43,7 +43,7 @@ impl FileReferences { } } -impl IntoIterator for FileReferences { +impl IntoIterator for UsageSearchResult { type Item = (FileId, Vec); type IntoIter = > as IntoIterator>::IntoIter; @@ -293,9 +293,8 @@ impl<'a> FindUsages<'a> { found } - /// The [`FileReferences`] returned always have unique [`FileId`]s. - pub fn all(self) -> FileReferences { - let mut res = FileReferences::default(); + pub fn all(self) -> UsageSearchResult { + let mut res = UsageSearchResult::default(); self.search(&mut |file_id, reference| { res.references.entry(file_id).or_default().push(reference); false -- cgit v1.2.3