You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Presumably line_span always returns a valid span. However, the API requires you to check the error anyway:
let line = file_db
.line_span(file, start.line).expect("line should be in bounds");println!("{}", file_db.source_slice(file, line).expect("line is still in bounds"));
I would like Files to get a new line_slice API which returns a Result<&str, LineIndexOutOfBoundsError> directly.
The text was updated successfully, but these errors were encountered:
Presumably
line_span
always returns a valid span. However, the API requires you to check the error anyway:I would like
Files
to get a newline_slice
API which returns aResult<&str, LineIndexOutOfBoundsError>
directly.The text was updated successfully, but these errors were encountered: