Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/lexed_str.rs')
| -rw-r--r-- | crates/parser/src/lexed_str.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/parser/src/lexed_str.rs b/crates/parser/src/lexed_str.rs index 7c78ba8faf..d7eec6cde8 100644 --- a/crates/parser/src/lexed_str.rs +++ b/crates/parser/src/lexed_str.rs @@ -150,7 +150,12 @@ struct Converter<'a> { impl<'a> Converter<'a> { fn new(edition: Edition, text: &'a str) -> Self { Self { - res: LexedStr { text, kind: Vec::new(), start: Vec::new(), error: Vec::new() }, + res: LexedStr { + text, + kind: Vec::with_capacity(text.len() / 3), + start: Vec::with_capacity(text.len() / 3), + error: Vec::new(), + }, offset: 0, edition, } |