From 229d1999944624abdfa96ab77686175c6d685a1c Mon Sep 17 00:00:00 2001 From: klensy Date: Fri, 26 Mar 2021 22:32:37 +0300 Subject: lazily calls some fns --- compiler/rustc_errors/src/json.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_errors') diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs index c27b39a9d62..2bce1ac3c0a 100644 --- a/compiler/rustc_errors/src/json.rs +++ b/compiler/rustc_errors/src/json.rs @@ -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, } -- cgit 1.4.1-3-g733a5