Reserve space in advance
This commit is contained in:
parent
2ca0b85593
commit
a7f2bb6343
4 changed files with 9 additions and 7 deletions
|
@ -221,7 +221,7 @@ impl TokenStream {
|
|||
}
|
||||
}
|
||||
if let Some((pos, comma, sp)) = suggestion {
|
||||
let mut new_stream = vec![];
|
||||
let mut new_stream = Vec::with_capacity(self.0.len() + 1);
|
||||
let parts = self.0.split_at(pos + 1);
|
||||
new_stream.extend_from_slice(parts.0);
|
||||
new_stream.push(comma);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue