Consumes the [`Parsed`] output and returns a [`Result`] which is [`Ok`] if it has no syntax errors, or [`Err`] containing the first [`ParseError`] encountered.
(self)
| 282 | /// Consumes the [`Parsed`] output and returns a [`Result`] which is [`Ok`] if it has no syntax |
| 283 | /// errors, or [`Err`] containing the first [`ParseError`] encountered. |
| 284 | pub(crate) fn into_result(self) -> Result<Parsed<T>, ParseError> { |
| 285 | if self.is_valid() { |
| 286 | Ok(self) |
| 287 | } else { |
| 288 | Err(self.into_errors().into_iter().next().unwrap()) |
| 289 | } |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | impl Parsed<Mod> { |
no test coverage detected