Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakis
Use a slice where a vector is not necessary
This commit is contained in:
commit
59f8422a17
15 changed files with 30 additions and 30 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue