(no title)
matjazdrolc | 2 years ago
Nom already has a parser for numbers. However, I didn't find an elegant way to take at most one digit. In the end I used take_while_m_n, and mapped it with u64::from_str().
Another challenge was absence of something such as find_all, that would repeatedly try to parse beginning from each character and then return all matches. I ended up writing my own combinator.
https://github.com/drola/AdventOfCode2023/blob/main/src/bin/...
woile|2 years ago
https://github.com/woile/adventofcode/blob/main/2023/day1/sr...
V41frQo1SccpfHI|2 years ago