4 ms·
Agreed. Most of my solutions[0] use something simple like input .lines() .map(|s| s.trim()) .filter(|l| l.len() > 0) .map(CustomType::from)
by K0nserv 8y ago
Agreed. Most of my solutions[0] use something simple like
input
.lines()
.map(|s| s.trim())
.filter(|l| l.len() > 0)
.map(CustomType::from)
.collect::<Vec<_>>();
or for grid-like puzzels
input
.lines()
.map(|s| s.trim())
.filter(|l| l.len() > 0)
.map(|l| l
.chars()
.map(CustomType::from)
.collect::<Vec<_>>()
)
.collect::<Vec<_>>();
0: https://github.com/k0nserv/advent-of-rust-2018 https://github.com/k0nserv/advent-of-rust-2018