Cleanup some option related code#1689
Conversation
sim642
left a comment
There was a problem hiding this comment.
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 <simmo.saan@gmail.com>
Co-authored-by: Simmo Saan <simmo.saan@gmail.com>
|
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.