lazily calls some fns
This commit is contained in:
parent
e423058751
commit
229d199994
7 changed files with 14 additions and 13 deletions
|
@ -493,7 +493,7 @@ impl DiagnosticSpanLine {
|
|||
h_end: usize,
|
||||
) -> DiagnosticSpanLine {
|
||||
DiagnosticSpanLine {
|
||||
text: sf.get_line(index).map_or(String::new(), |l| l.into_owned()),
|
||||
text: sf.get_line(index).map_or_else(String::new, |l| l.into_owned()),
|
||||
highlight_start: h_start,
|
||||
highlight_end: h_end,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue