Document that line/col indices are 0 based

This commit is contained in:
Oliver Schneider 2017-05-09 17:08:26 +02:00 committed by GitHub
parent 26d39b3a15
commit 80ed3e7a7b

View file

@ -1064,6 +1064,8 @@ impl<'a> Deserializer<'a> {
impl Error { impl Error {
/// Produces a (line, column) pair of the position of the error if available /// Produces a (line, column) pair of the position of the error if available
///
/// All indexes are 0-based.
pub fn line_col(&self) -> Option<(usize, usize)> { pub fn line_col(&self) -> Option<(usize, usize)> {
self.inner.line.map(|line| (line, self.inner.col)) self.inner.line.map(|line| (line, self.inner.col))
} }