Skip to content

Commit 160a7b0

Browse files
committed
initialize vector to required size.
1 parent 5df6259 commit 160a7b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/ide/src/annotations.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub(crate) fn annotations(
116116
}
117117

118118
if config.annotate_enum_variant_references {
119-
let mut enum_variants_metadata: Vec<(TextRange, TextSize)> = Vec::new();
119+
let mut enum_variants_metadata: Vec<(TextRange, TextSize)> = Vec::with_capacity(ranges_enum_variants.len());
120120
for range_enum_variant in ranges_enum_variants.into_iter() {
121121
let (range, offset) = match range_enum_variant {
122122
Some(range) => (range, range.start()),

0 commit comments

Comments
 (0)