8000 fix: Make span_to_lines return at least one line · Muscraft/annotate-snippets-rs@3d4d913 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 3d4d913

Browse files
committed
fix: Make span_to_lines return at least one line
1 parent e8ac439 commit 3d4d913

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/renderer/source_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl<'a> SourceMap<'a> {
124124
if start >= line_info.end_byte {
125125
continue;
126126
}
127-
if end <= line_info.start_byte {
127+
if end < line_info.start_byte {
128128
break;
129129
}
130130
lines.push(line_info);

tests/rustc_tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2966,7 +2966,6 @@ LL | /// This is a long line that contains a <http://link.com>
29662966
}
29672967

29682968
#[test]
2969-
#[should_panic = "attempt to subtract with overflow"]
29702969
fn array_into_iter() {
29712970
let source1 = r#"#![allow(unused)]
29722971
fn main() {

0 commit comments

Comments
 (0)
0