MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / map_parse_result

Function map_parse_result

crates/hyperqueue/src/common/parser.rs:203–208  ·  view source on GitHub ↗
(
    result: Result<O, nom::Err<ParserError<&str>>>,
    input: &str,
)

Source from the content-addressed store, hash-verified

201pub type NomResult<'a, Ret> = IResult<&'a str, Ret, ParserError<&'a str>>;
202
203pub fn map_parse_result<O>(
204 result: Result<O, nom::Err<ParserError<&str>>>,
205 input: &str,
206) -> anyhow::Result<O> {
207 result.map_err(|e| format_parse_error(e, input))
208}
209
210/// Take a parser and input and return Result with a formatted error.
211pub fn consume_all<'a, O, F>(f: F, input: &'a str) -> anyhow::Result<O>

Callers 1

consume_allFunction · 0.85

Calls 1

format_parse_errorFunction · 0.85

Tested by

no test coverage detected