My solutions for Advent of Code.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
adventofcode/2022/src/helpers.rs

12 lines
298 B

/*
* Use this file if you want to extract helpers from your solutions.
* Example import from this file: `use advent_of_code::helpers::example_fn;`.
*/
2 years ago
pub fn parse_input<T>(input: &str, cons: fn(&str) -> T) -> Vec<T>
where
Vec<T>: FromIterator<T>,
{
input.lines().map(cons).collect()
}