(&self, f: &mut fmt::Formatter<'_>)
| 180 | |
| 181 | impl fmt::Display for TokenizeError { |
| 182 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 183 | match self { |
| 184 | TokenizeError::BinaryContent { reason } => { |
| 185 | write!(f, "binary content detected: {}", reason) |
| 186 | } |
| 187 | TokenizeError::LineTooLong { |
| 188 | line_number, |
| 189 | length, |
| 190 | max_length, |
| 191 | } => { |
| 192 | write!( |
| 193 | f, |
| 194 | "line {} is too long ({} bytes, max {})", |
| 195 | line_number, length, max_length |
| 196 | ) |
| 197 | } |
| 198 | TokenizeError::InvalidUtf8 { |
| 199 | line_number, |
| 200 | offset, |
| 201 | } => { |
| 202 | write!( |
| 203 | f, |
| 204 | "invalid UTF-8 at line {}, offset {}", |
| 205 | line_number, offset |
| 206 | ) |
| 207 | } |
| 208 | } |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | impl std::error::Error for TokenizeError {} |
nothing calls this directly
no outgoing calls
no test coverage detected