Skip to main content

parse_error_to_element_error

Function parse_error_to_element_error 

Source
fn parse_error_to_element_error<'i>(
    e: ParseError<'i>,
    attr: QualName,
) -> ElementError
Expand description

Convert a short-lived ParseError into a long-lived ElementError

We extract this as a function, instead of putting it directly in the map_err invocation below in impl<'i, O> AttributeResultExt<O> for Result<O, ParseError<'i>>, because putting it there as a closure generates too many duplicated copies of the code. The generic parameter O in that impl is for the result Ok() value, not for the Err, after all.