Function advent_of_code_2021::day_12::get_index[−][src]

fn get_index<'a>(
    caves: &mut Vec<Cave>,
    lookup: &mut HashMap<&'a str, usize>,
    label: &'a str
) -> usize
Expand description

Helper for parse_input that handles mapping a label to an index in the cave vector, initialising a cave and dding it to the vector and lookup table if it’s a new cave.