diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/de.rs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1063,6 +1063,13 @@ impl<'a> Deserializer<'a> { } impl Error { + /// 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)> { + self.inner.line.map(|line| (line, self.inner.col)) + } + fn from_kind(kind: ErrorKind) -> Error { Error { inner: Box::new(ErrorInner { |