Length of the invalid encoding
(&self, subject: &str)
| 1192 | } |
| 1193 | /// Length of the invalid encoding |
| 1194 | pub fn invalid_encoding_len(&self, subject: &str) -> usize { |
| 1195 | match self { |
| 1196 | Self::NoLeadingSlash => 0, |
| 1197 | Self::InvalidEncoding { offset, .. } => { |
| 1198 | if *offset < subject.len() - 1 { |
| 1199 | 2 |
| 1200 | } else { |
| 1201 | 1 |
| 1202 | } |
| 1203 | } |
| 1204 | } |
| 1205 | } |
| 1206 | } |
| 1207 | |
| 1208 | impl Diagnostic for ParseError { |