initialize vector to required size.

This commit is contained in:
Eric Sampson 2021-10-04 16:14:01 -05:00
parent 5df6259996
commit 160a7b097a

View File

@ -116,7 +116,7 @@ pub(crate) fn annotations(
}
if config.annotate_enum_variant_references {
let mut enum_variants_metadata: Vec<(TextRange, TextSize)> = Vec::new();
let mut enum_variants_metadata: Vec<(TextRange, TextSize)> = Vec::with_capacity(ranges_enum_variants.len());
for range_enum_variant in ranges_enum_variants.into_iter() {
let (range, offset) = match range_enum_variant {
Some(range) => (range, range.start()),