Shared: Clean up NodeInfo
in shared extractor
#14326
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was perusing the shared extractor the other day, when I came across the
NodeInfo
struct. I noticed that thefields
andsubtypes
fields on this struct had two seemingly identical ways of expressing the same thing:None
andSome(empty)
(whereempty
is respectively the empty map and the empty vector). As far as I can tell, there's no semantic difference in either case, so we can just elide the option type entirely and use the empty value directly. This has the nice side-effect of cleaning up some of the other code.(Of course, I am happy to be proven wrong about the semantics of the values of the above fields, if there actually is a reason for this choice! 🙂)