lazily calls some fns

This commit is contained in:
klensy 2021-03-26 22:32:37 +03:00
parent e423058751
commit 229d199994
7 changed files with 14 additions and 13 deletions

View file

@ -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,
}