advent-of-code-rust icon indicating copy to clipboard operation
advent-of-code-rust copied to clipboard

Have parts use Result instead of Option

Open ahenshaw opened this issue 1 year ago • 1 comments

Would it be better to return a Result instead of an Option for the parts? Given the nature of the puzzles, we should be generating either a value or an error. Plus, I'd like to replace all of my unwraps with "?"s.

ahenshaw avatar Dec 03 '24 13:12 ahenshaw

I'd like to replace all of my unwraps with "?"s

You can append .ok() to results to cast them to an option, then your ? will work.

fspoettel avatar Dec 03 '24 13:12 fspoettel