about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/json.rs
diff options
context:
space:
mode:
authorklensy <klensy@users.noreply.github.com>2021-03-26 22:32:37 +0300
committerklensy <klensy@users.noreply.github.com>2021-03-27 10:20:32 +0300
commit229d1999944624abdfa96ab77686175c6d685a1c (patch)
tree98389502381bdbbb4bd275e5351cd01ea2771cfd /compiler/rustc_errors/src/json.rs
parente423058751a2b098d3e469a8e6df1b7a8bbd67b6 (diff)
downloadrust-229d1999944624abdfa96ab77686175c6d685a1c.tar.gz
rust-229d1999944624abdfa96ab77686175c6d685a1c.zip
lazily calls some fns
Diffstat (limited to 'compiler/rustc_errors/src/json.rs')
-rw-r--r--compiler/rustc_errors/src/json.rs2
1 files changed, 1 insertions, 1 deletions
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,
         }