1
Fork 0

Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakis

Use a slice where a vector is not necessary
This commit is contained in:
kennytm 2018-07-28 16:25:07 +08:00 committed by GitHub
commit 59f8422a17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 30 additions and 30 deletions

View file

@ -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)