Document that line/col indices are 0 based
This commit is contained in:
parent
26d39b3a15
commit
80ed3e7a7b
|
@ -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))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue