Skip to content

Commit 63c1d68

Browse files
committed
update function's doc comment
1 parent 39d5465 commit 63c1d68

File tree

1 file changed

+5
-6
lines changed
  • cpp-linter/src/common_fs

1 file changed

+5
-6
lines changed

Diff for: cpp-linter/src/common_fs/mod.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,17 @@ impl FileObj {
219219
}
220220
}
221221

222-
/// Gets the line and column number from a given `offset` (of bytes) for given
223-
/// `file_path`.
222+
/// Gets the line number for a given `offset` (of bytes) from given the
223+
/// byte array `contents`.
224224
///
225-
/// This computes the line and column numbers from a buffer of bytes read from the
226-
/// `file_path`. In non-UTF-8 encoded files, this does not guarantee that a word
225+
/// This computes the line number from a buffer of bytes.
226+
/// In non-UTF-8 encoded files, this does not guarantee that a word
227227
/// boundary exists at the returned column number. However, the `offset` given to this
228228
/// function is expected to originate from diagnostic information provided by
229-
/// clang-format or clang-tidy.
229+
/// clang-format.
230230
pub fn get_line_count_from_offset(contents: &[u8], offset: u32) -> u32 {
231231
let offset = (offset as usize).min(contents.len());
232232
let lines = contents[0..offset].split(|byte| byte == &b'\n');
233-
234233
lines.count() as u32
235234
}
236235

0 commit comments

Comments
 (0)