drive by fix needless allocation of const string number
This commit is contained in:
parent
989d1a732f
commit
68ea8ff16f
1 changed files with 6 additions and 2 deletions
|
@ -771,8 +771,12 @@ impl EmitterWriter {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
fn maybe_anonymized(&self, line_num: usize) -> String {
|
fn maybe_anonymized(&self, line_num: usize) -> Cow<'static, str> {
|
||||||
if self.ui_testing { ANONYMIZED_LINE_NUM.to_string() } else { line_num.to_string() }
|
if self.ui_testing {
|
||||||
|
Cow::Borrowed(ANONYMIZED_LINE_NUM)
|
||||||
|
} else {
|
||||||
|
Cow::Owned(line_num.to_string())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn draw_line(
|
fn draw_line(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue