It would be the case that I stay up until gone midnight writing a helper library ready for today's AdventOfCode, only to find that today's doesn't need the library :(
Clever! I decided to hack a direct proc_macro approach and came up with git.gitano.org.uk/parsebyreg⦠which is horrific in all senses, but does work for me, moderately complicatedly. It'd need serious refactorage before it could be primetime though.
Also, do you know of any serde type thing where I could annotate a struct with a regexp with named captures of the fields, and have a derived parser for cheap?
One thing I really need to get on, is naming my captures in my regular expressions. I'm bored with "cap.get(n).ok_or("what, no foo?")?.as_str()......" type stuff :-)
Your approach to day4 was a tad wordier than mine but seems to have been similar. I'm trying to do your thing of not panic!()ing etc. It has been instructive in error propagation for me :-D
git.gitano.org.uk/personal/d⦠if you're interested :-)
That's how it starts. Then you'll start to learn some of the grammar and you'll begin to write Rusty code.
Sometimes though, it's just list comprehensions to solve AoC problems :-D