(mut self, range: Range, file_text: &str)
| 182 | /// Attaches position info to an error that doesn't have any yet. |
| 183 | #[cfg(feature = "serde")] |
| 184 | pub(crate) fn with_position(mut self, range: Range, file_text: &str) -> ParseError { |
| 185 | if self.0.range.start == 0 && self.0.range.end == 0 { |
| 186 | let (line_display, column_display) = get_line_and_column_display(range, file_text); |
| 187 | self.0.range = range; |
| 188 | self.0.line_display = line_display; |
| 189 | self.0.column_display = column_display; |
| 190 | } |
| 191 | self |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | impl fmt::Display for ParseError { |
no test coverage detected