make Parse generic

This commit is contained in:
Aleksey Kladov 2019-07-18 22:29:20 +03:00
parent abe72424a6
commit a6224f3620
5 changed files with 44 additions and 23 deletions

View file

@ -9,7 +9,7 @@ use ra_db::{
FileTextQuery, SourceRootId,
};
use ra_prof::{memory_usage, Bytes};
use ra_syntax::{AstNode, Parse, SyntaxNode, TreeArc};
use ra_syntax::{ast, AstNode, Parse, SyntaxNode, TreeArc};
use crate::{
db::RootDatabase,
@ -79,10 +79,10 @@ impl fmt::Display for SyntaxTreeStats {
}
}
impl FromIterator<TableEntry<FileId, Parse>> for SyntaxTreeStats {
impl FromIterator<TableEntry<FileId, Parse<ast::SourceFile>>> for SyntaxTreeStats {
fn from_iter<T>(iter: T) -> SyntaxTreeStats
where
T: IntoIterator<Item = TableEntry<FileId, Parse>>,
T: IntoIterator<Item = TableEntry<FileId, Parse<ast::SourceFile>>>,
{
let mut res = SyntaxTreeStats::default();
for entry in iter {