Re-implement InFile wrappers as type aliases over generic InFileWrapper

This commit is contained in:
Lukas Wirth 2023-11-25 14:39:55 +01:00
parent 30093a6d81
commit c43078f99d
13 changed files with 151 additions and 107 deletions

View file

@ -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;
}