diff options
| author | klensy <klensy@users.noreply.github.com> | 2021-03-26 22:32:37 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2021-03-27 10:20:32 +0300 |
| commit | 229d1999944624abdfa96ab77686175c6d685a1c (patch) | |
| tree | 98389502381bdbbb4bd275e5351cd01ea2771cfd /compiler/rustc_errors/src/json.rs | |
| parent | e423058751a2b098d3e469a8e6df1b7a8bbd67b6 (diff) | |
| download | rust-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.rs | 2 |
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, } |
