day16 started
This commit is contained in:
parent
96fca503ab
commit
daa8b6b1d0
3 changed files with 140 additions and 5 deletions
|
|
@ -9,9 +9,9 @@ pub fn read_lines(day_num: usize, file: &str) -> io::Result<Vec<String>> {
|
|||
Ok(fs::read_to_string(format_path(day_num, file))?
|
||||
.split('\n')
|
||||
.with_position()
|
||||
.filter_map(|line| match line {
|
||||
(itertools::Position::Last, line) if line.is_empty() => None,
|
||||
(_, line) => Some(line.to_string()),
|
||||
.filter_map(|(pos, line)| match pos {
|
||||
itertools::Position::Last if line.is_empty() => None,
|
||||
_ => Some(line.to_owned()),
|
||||
})
|
||||
.collect())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue