fn build_string(input: Span) -> ParseResult<String> {
    fold_many0(
        // Our parser function– parses a single string fragment
        parse_fragment,
        // Our init value, an empty string
        String::new(),
        // Our folding function. For each fragment, append the fragment to the
        // string.
        |mut string, fragment| {
            match fragment {
                StringFragment::Literal(s) => string.push_str(s.fragment()),
                StringFragment::EscapedChar(c) => string.push(c),
                StringFragment::EscapedWs => {}
            }
            string
        },
    )(input)
}
/// fold_many0 is the equivalent of iterator::fold. It runs a parser in a loop,
/// and for each output value, calls a folding function on each output value.
fold_many0 is the equivalent of iterator::fold. It runs a parser in a loop,
and for each output value, calls a folding function on each output value.
fold_many0 is the equivalent of iterator :: fold . It runs a parser in a loop and for each output value calls a folding function on each output value .
fn build_string(input: Span) -> ParseResult<String> {
    fold_many0(
        // Our parser function– parses a single string fragment
        parse_fragment,
        // Our init value, an empty string
        String::new(),
        // Our folding function. For each fragment, append the fragment to the
        // string.
        |mut string, fragment| {
            match fragment {
                StringFragment::Literal(s) => string.push_str(s.fragment()),
                StringFragment::EscapedChar(c) => string.push(c),
                StringFragment::EscapedWs => {}
            }
            string
        },
    )(input)
}
fn build_string ( input : Span ) -> ParseResult < String > { fold_many0 ( // Our parser function– parses a single string fragment parse_fragment , // Our init value, an empty string String :: new ( ) , // Our folding function. For each fragment, append the fragment to the // string. | mut string , fragment | { match fragment { StringFragment :: Literal ( s ) => string . push_str ( s . fragment ( ) ) , StringFragment :: EscapedChar ( c ) => string . push ( c ) , StringFragment :: EscapedWs => { } } string } , ) ( input ) }
fold_many0 is the equivalent of iterator::fold.
fold_many0 is the equivalent of iterator :: fold .
input
Span