Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Have parts use Result instead of Option #71

Open
ahenshaw opened this issue Dec 3, 2024 · 1 comment
Open

Have parts use Result instead of Option #71

ahenshaw opened this issue Dec 3, 2024 · 1 comment

Comments

@ahenshaw
Copy link

ahenshaw commented Dec 3, 2024

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.

@fspoettel
Copy link
Owner

fspoettel commented Dec 3, 2024

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants