Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 1cf7480

Browse files
committed
Improve docs
1 parent ed498b6 commit 1cf7480

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/line-index/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,15 @@ impl LineIndex {
143143
///
144144
/// # Panics
145145
///
146-
/// If the offset is invalid.
146+
/// If the offset is invalid. See [`Self::try_line_col`].
147147
pub fn line_col(&self, offset: TextSize) -> LineCol {
148148
self.try_line_col(offset).expect("invalid offset")
149149
}
150150

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.
154155
pub fn try_line_col(&self, offset: TextSize) -> Option<LineCol> {
155156
if offset > self.size {
156157
return None;

0 commit comments

Comments
 (0)