pub fn parse(content: &str) -> (Vec<char>, HashMap<(char, char), char>) {
    let mut parts = content.split("\n\n");

    let template = parts
        .next()
        .expect("No template")
        .chars()
        .collect::<Vec<_>>();

    let rules = parts
        .next()
        .expect("No rules")
        .lines()
        .map(|line| {
            let mut chars = line.chars();
            let a = chars.next().expect("No first char");
            let b = chars.next().expect("No second char");
            let c = chars.skip(4).next().expect("No resulting char");
            ((a, b), c)
        })
        .collect::<HashMap<_, _>>();

    (template, rules)
}
// tag::parse[]
/// porse content into a vector of chars and a map with pairs of chars as keys and the
/// char to be inserted as value
:parse[]
porse content into a vector of chars and a map with pairs of chars as keys and the
char to be inserted as value
: parse [] porse content into a vector of chars and a map with pairs of chars as keys and the char to be inserted as value
pub fn parse(content: &str) -> (Vec<char>, HashMap<(char, char), char>) {
    let mut parts = content.split("\n\n");
    let template = parts
        .next()
        .expect("No template")
        .chars()
        .collect::<Vec<_>>();
    let rules = parts
        .next()
        .expect("No rules")
        .lines()
        .map(|line| {
            let mut chars = line.chars();
            let a = chars.next().expect("No first char");
            let b = chars.next().expect("No second char");
            let c = chars.skip(4).next().expect("No resulting char");
            ((a, b), c)
        })
        .collect::<HashMap<_, _>>();
    (template, rules)
}
pub fn parse ( content : & str ) -> ( Vec < char > , HashMap < ( char , char ) , char > ) { let mut parts = content . split ( " \n \n " ) ; let template = parts . next ( ) . expect ( " " ) . chars ( ) . collect :: < Vec < _ > > ( ) ; let rules = parts . next ( ) . expect ( " " ) . lines ( ) . map ( | line | { let mut chars = line . chars ( ) ; let a = chars . next ( ) . expect ( " " ) ; let b = chars . next ( ) . expect ( " " ) ; let c = chars . skip ( 4 ) . next ( ) . expect ( " " ) ; ( ( a , b ) , c ) } ) . collect :: < HashMap < _ , _ > > ( ) ; ( template , rules ) }
tag::parse[]
porse content into a vector of chars and a map with pairs of chars as keys and the
char to be inserted as value
tag :: parse [] porse content into a vector of chars and a map with pairs of chars as keys and the char to be inserted as value
content
&str
content
&str