-
Notifications
You must be signed in to change notification settings - Fork 88
Cleanup some option related code
#1689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
sim642
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This simplifies some uses but I'm unsure about others.
In particular, replacing some matches with large bodies with Option.map_default (or similar) sometimes moves what's being matched much further down (after the lambda). This might hurt readability because the code doesn't read top-down as it executes.
I think it would be good for someone else to also have a look with this in mind to see if they also get this impression.
Co-authored-by: Simmo Saan <[email protected]>
Co-authored-by: Simmo Saan <[email protected]>
|
What is our plan here? Which ones do we want to merge and what do we want to close? |
|
Apart from Simmo's open questions I would take this as is, it is in general a good improvement. Out-of-scope for this PR, but somehow related:
|
Using
map_default,map_default_delayed, and friends makes the code much more concise.