Recognizes a [`RawPackageName`] in a string slice. # Errors Returns an error if no [`RawPackageName`] can be found in `input`.
(input: &mut &str)
| 636 | /// |
| 637 | /// Returns an error if no [`RawPackageName`] can be found in `input`. |
| 638 | fn function_line(input: &mut &str) -> ModalResult<RawPackageName> { |
| 639 | // Parse the start of the line. |
| 640 | // |
| 641 | // The start `FUNCTION` may backtrack. This indicates that the next section has been |
| 642 | // hit. **Everything else** will return a hard error, as it indicates invalid or |
| 643 | // unexpected bridge output. |
| 644 | ("FUNCTION").parse_next(input)?; |
| 645 | let package_name = RawPackageName::parser.parse_next(input)?; |
| 646 | |
| 647 | cut_err((space0, alt((eof, "\n")))) |
| 648 | .context(StrContext::Label("character")) |
| 649 | .context(StrContext::Expected(StrContextValue::Description( |
| 650 | "end of line or end of file.", |
| 651 | ))) |
| 652 | .parse_next(input)?; |
| 653 | |
| 654 | Ok(package_name) |
| 655 | } |
| 656 | } |
nothing calls this directly
no outgoing calls
no test coverage detected