mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Re-implement InFile wrappers as type aliases over generic InFileWrapper
This commit is contained in:
parent
30093a6d81
commit
c43078f99d
13 changed files with 151 additions and 107 deletions
|
@ -2,7 +2,7 @@ use std::{fmt, marker::PhantomData};
|
|||
|
||||
use hir::{
|
||||
db::{AstIdMapQuery, AttrsQuery, BlockDefMapQuery, ParseMacroExpansionQuery},
|
||||
Attr, Attrs, ExpandResult, MacroFile, Module,
|
||||
Attr, Attrs, ExpandResult, MacroFileId, Module,
|
||||
};
|
||||
use ide_db::{
|
||||
base_db::{
|
||||
|
@ -199,8 +199,12 @@ impl StatCollect<FileId, Parse<ast::SourceFile>> for SyntaxTreeStats<false> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<M> StatCollect<MacroFile, ExpandResult<(Parse<SyntaxNode>, M)>> for SyntaxTreeStats<true> {
|
||||
fn collect_entry(&mut self, _: MacroFile, value: Option<ExpandResult<(Parse<SyntaxNode>, M)>>) {
|
||||
impl<M> StatCollect<MacroFileId, ExpandResult<(Parse<SyntaxNode>, M)>> for SyntaxTreeStats<true> {
|
||||
fn collect_entry(
|
||||
&mut self,
|
||||
_: MacroFileId,
|
||||
value: Option<ExpandResult<(Parse<SyntaxNode>, M)>>,
|
||||
) {
|
||||
self.total += 1;
|
||||
self.retained += value.is_some() as usize;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue