Skip to content

Commit

Permalink
Do not panic on empty input.
Browse files Browse the repository at this point in the history
  • Loading branch information
01mf02 authored and zesterer committed Nov 7, 2023
1 parent b2d478b commit 72f6278
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl<I: AsRef<str>> Source<I> {
.lines
.binary_search_by_key(&offset, |line| line.offset)
.unwrap_or_else(|idx| idx.saturating_sub(1));
let line = self.lines[idx];
let line = self.line(idx)?;
assert!(
offset >= line.offset,
"offset = {}, line.offset = {}",
Expand Down

0 comments on commit 72f6278

Please sign in to comment.