diff --git a/src/emitter/json.rs b/src/emitter/json.rs index 39eae1ab0f2..8c84ff72d04 100644 --- a/src/emitter/json.rs +++ b/src/emitter/json.rs @@ -57,7 +57,7 @@ impl JsonEmitter { filename: &FileName, diff: Vec, ) -> Result<(), io::Error> { - let mut mismatches = vec![]; + let mut mismatches = Vec::with_capacity(diff.len()); for mismatch in diff { let original_begin_line = mismatch.line_number_orig; let expected_begin_line = mismatch.line_number;