diff options
| author | ljedrz <ljedrz@gmail.com> | 2018-07-27 16:50:28 +0200 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2018-07-27 16:50:28 +0200 |
| commit | 1cca4204357454dbf2e2b7f57f9f024631da209f (patch) | |
| tree | d53c0935f32ed2d688a59b0c42bc18cc0cb5806b /src/librustc_errors | |
| parent | b18b9edf006c10f4e08794d31425001401e27a09 (diff) | |
| download | rust-1cca4204357454dbf2e2b7f57f9f024631da209f.tar.gz rust-1cca4204357454dbf2e2b7f57f9f024631da209f.zip | |
Use slices where a vector is not necessary
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/emitter.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index 6bcf0d9eff6..f54626d6a20 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -749,7 +749,7 @@ impl EmitterWriter { max } - fn get_max_line_num(&mut self, span: &MultiSpan, children: &Vec<SubDiagnostic>) -> usize { + fn get_max_line_num(&mut self, span: &MultiSpan, children: &[SubDiagnostic]) -> usize { let mut max = 0; let primary = self.get_multispan_max_line_num(span); @@ -954,7 +954,7 @@ impl EmitterWriter { fn emit_message_default(&mut self, msp: &MultiSpan, - msg: &Vec<(String, Style)>, + msg: &[(String, Style)], code: &Option<DiagnosticId>, level: &Level, max_line_num_len: usize, @@ -1317,10 +1317,10 @@ impl EmitterWriter { fn emit_messages_default(&mut self, level: &Level, - message: &Vec<(String, Style)>, + message: &[(String, Style)], code: &Option<DiagnosticId>, span: &MultiSpan, - children: &Vec<SubDiagnostic>, + children: &[SubDiagnostic], suggestions: &[CodeSuggestion]) { let max_line_num_len = if self.ui_testing { ANONYMIZED_LINE_NUM.len() @@ -1433,7 +1433,7 @@ fn overlaps(a1: &Annotation, a2: &Annotation, padding: usize) -> bool { num_overlap(a1.start_col, a1.end_col + padding, a2.start_col, a2.end_col, false) } -fn emit_to_destination(rendered_buffer: &Vec<Vec<StyledString>>, +fn emit_to_destination(rendered_buffer: &[Vec<StyledString>], lvl: &Level, dst: &mut Destination, short_message: bool) |
