Skip to content

Commit afaf611

Browse files
xbfsBofeng BF1 Xue
andauthored
fix(Reader): avoid panic on single match (#35)
Co-authored-by: Bofeng BF1 Xue <xuebf1@Lenovo.com>
1 parent fc9ba2d commit afaf611

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

DraftRetriever/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ impl Reader {
285285
}
286286

287287
let start_of_indices = start_of_indices.unwrap();
288-
let end_of_indices = end_of_indices.unwrap();
288+
let end_of_indices = end_of_indices.unwrap_or(start_of_indices);
289289

290290
let mut suffixes = vec![0; end_of_indices - start_of_indices + 4];
291291

0 commit comments

Comments
 (0)