From a21b7b3b162932011b83f4703fb87030c216e962 Mon Sep 17 00:00:00 2001 From: varkor Date: Sat, 27 Jan 2018 15:16:42 +0000 Subject: [PATCH] Improve formatting of else block --- src/librustc_errors/emitter.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index a9f228ca729b1..63c4ae5561c92 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -1016,7 +1016,9 @@ impl EmitterWriter { let loc = if let Some(first_line) = annotated_file.lines.first() { let col = if let Some(first_annotation) = first_line.annotations.first() { format!(":{}", first_annotation.start_col + 1) - } else { "".to_string() }; + } else { + "".to_string() + }; format!("{}:{}{}", annotated_file.file.name, cm.doctest_offset_line(first_line.line_index),