quil_rs::program

Function map_parsed

Source
pub fn map_parsed<O, O2>(
    result: Result<O, ParseProgramError<O>>,
    map: impl Fn(O) -> O2,
) -> Result<O2, ParseProgramError<O2>>
Expand description

Map the parsed output into another value.

This should be preferred over Result::map, as this will map both the Ok case and when there is a LeftoverError.