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 :-)
1
Nice! But yeah, I'm really not happy at all with my day 4 answer. I think the code could be much clearer than what I wrote. But yeah, this is a really excellent opportunity to get some error handling experience. :-)
1
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 :-)
1
1
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?
1
I don't, although it sounds like a great idea!
1
Replying to @burntsushi5
I'm imagining a fairly simple regex -> json converter and then serde_json perhaps.

Dec 4, 2018 Β· 4:36 PM UTC

1
I don't think you need a proc macro actually! I think just implementing a serde deserialzer would be pretty great!
1