Skip to content

Commit 159d8a4

Browse files
committed
Remove a loop which runs exactly once
1 parent 23f890f commit 159d8a4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/librustc_errors/emitter.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,10 +1817,9 @@ impl FileWithAnnotatedLines {
18171817
// Every `|` that joins the beginning of the span (`___^`) to the end (`|__^`).
18181818
add_annotation_to_file(&mut output, file.clone(), line, ann.as_line());
18191819
}
1820-
if middle < ann.line_end - 1 {
1821-
for line in ann.line_end - 1..ann.line_end {
1822-
add_annotation_to_file(&mut output, file.clone(), line, ann.as_line());
1823-
}
1820+
let line_end = ann.line_end - 1;
1821+
if middle < line_end {
1822+
add_annotation_to_file(&mut output, file.clone(), line_end, ann.as_line());
18241823
}
18251824
} else {
18261825
end_ann.annotation_type = AnnotationType::Singleline;

0 commit comments

Comments
 (0)