mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Use reserve_exact for pushing to Subtree
This commit is contained in:
parent
8011b56827
commit
a607e1b04b
2 changed files with 13 additions and 6 deletions
|
@ -361,9 +361,7 @@ fn panic_expand(
|
|||
};
|
||||
|
||||
// FIXME(slow): quote! have a way to expand to builder to make this a vec!
|
||||
let mut mutable_trees = std::mem::take(&mut call.token_trees).into_vec();
|
||||
mutable_trees.push(tt::TokenTree::Subtree(subtree));
|
||||
call.token_trees = mutable_trees.into_boxed_slice();
|
||||
call.push(tt::TokenTree::Subtree(subtree));
|
||||
|
||||
ExpandResult::ok(call)
|
||||
}
|
||||
|
@ -395,9 +393,7 @@ fn unreachable_expand(
|
|||
};
|
||||
|
||||
// FIXME(slow): quote! have a way to expand to builder to make this a vec!
|
||||
let mut mutable_trees = std::mem::take(&mut call.token_trees).into_vec();
|
||||
mutable_trees.push(tt::TokenTree::Subtree(subtree));
|
||||
call.token_trees = mutable_trees.into_boxed_slice();
|
||||
call.push(tt::TokenTree::Subtree(subtree));
|
||||
|
||||
ExpandResult::ok(call)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue