Add more error handling

This commit is contained in:
hal8174 2025-08-08 12:57:46 +02:00
parent 9065bfd7b4
commit 5b5e491cb2
Signed by: hal8174
SSH key fingerprint: SHA256:NN98ZYwnrreQLSOV/g+amY7C3yL/mS1heD7bi5t6PPw
4 changed files with 144 additions and 57 deletions

View file

@ -62,7 +62,7 @@ impl SourceCode for SourceFile {
}
})
.map(|x| x + span.offset())
.unwrap_or(data[span.offset()..].len());
.unwrap_or(data.len());
let compact_data = &data[start_pos..end_pos];