mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 18:43:01 +00:00
shrink_to_fit() in more places
This saves 18mb on `analysis-stats .`, without regressing speed.
This commit is contained in:
parent
5ff4ba347d
commit
1fe060719a
8 changed files with 51 additions and 27 deletions
|
|
@ -223,7 +223,10 @@ impl ItemTree {
|
|||
}
|
||||
|
||||
fn shrink_to_fit(&mut self) {
|
||||
if let Some(data) = &mut self.data {
|
||||
let ItemTree { top_level, attrs, data } = self;
|
||||
top_level.shrink_to_fit();
|
||||
attrs.shrink_to_fit();
|
||||
if let Some(data) = data {
|
||||
let ItemTreeData {
|
||||
uses,
|
||||
extern_crates,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue