mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
do something with library_symbols
This commit is contained in:
parent
176f4da77a
commit
1280887561
3 changed files with 36 additions and 63 deletions
|
@ -11,7 +11,6 @@ use ide_db::{
|
|||
};
|
||||
use itertools::Itertools;
|
||||
use profile::{memory_usage, Bytes};
|
||||
use rustc_hash::FxHashMap;
|
||||
use std::env;
|
||||
use stdx::format_to;
|
||||
use syntax::{ast, Parse, SyntaxNode};
|
||||
|
@ -149,20 +148,16 @@ impl fmt::Display for LibrarySymbolsStats {
|
|||
}
|
||||
}
|
||||
|
||||
impl FromIterator<TableEntry<(), Arc<FxHashMap<SourceRootId, SymbolIndex>>>>
|
||||
for LibrarySymbolsStats
|
||||
{
|
||||
impl FromIterator<TableEntry<SourceRootId, Arc<SymbolIndex>>> for LibrarySymbolsStats {
|
||||
fn from_iter<T>(iter: T) -> LibrarySymbolsStats
|
||||
where
|
||||
T: IntoIterator<Item = TableEntry<(), Arc<FxHashMap<SourceRootId, SymbolIndex>>>>,
|
||||
T: IntoIterator<Item = TableEntry<SourceRootId, Arc<SymbolIndex>>>,
|
||||
{
|
||||
let mut res = LibrarySymbolsStats::default();
|
||||
for entry in iter {
|
||||
let value = entry.value.unwrap();
|
||||
for symbols in value.values() {
|
||||
res.total += symbols.len();
|
||||
res.size += symbols.memory_size();
|
||||
}
|
||||
let symbols = entry.value.unwrap();
|
||||
res.total += symbols.len();
|
||||
res.size += symbols.memory_size();
|
||||
}
|
||||
res
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue