home ~ projects ~ socials

Apply Type To Tuple Parser In Rust's nom Crate

TODO

    Write this up as a full example

tuple((
    tag("```"),
    not_line_ending,
    line_ending,
    take_until("```"),
    tag("```"),
))
.map(
    |(_, x, _, y, _): (&str, &str, &str, &str, &str)| Section::Code {
        lang: Some(x.trim().to_string()),
        text: y.trim().to_string(),
    },
),
-- end of line --