File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -143,14 +143,15 @@ impl LineIndex {
143
143
///
144
144
/// # Panics
145
145
///
146
- /// If the offset is invalid.
146
+ /// If the offset is invalid. See [`Self::try_line_col`].
147
147
pub fn line_col ( & self , offset : TextSize ) -> LineCol {
148
148
self . try_line_col ( offset) . expect ( "invalid offset" )
149
149
}
150
150
151
- /// Transforms the `TextSize` into a `LineCol`, or returns `None` if the `offset` was invalid,
152
- /// e.g. if it extends past the end of the text or points to the middle of a multi-byte
153
- /// character.
151
+ /// Transforms the `TextSize` into a `LineCol`.
152
+ ///
153
+ /// Returns `None` if the `offset` was invalid, e.g. if it extends past the end of the text or
154
+ /// points to the middle of a multi-byte character.
154
155
pub fn try_line_col ( & self , offset : TextSize ) -> Option < LineCol > {
155
156
if offset > self . size {
156
157
return None ;
You can’t perform that action at this time.
0 commit comments