Skip to content

Shared: Clean up NodeInfo in shared extractor #14326

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

Merged
merged 1 commit into from
Sep 27, 2023
Merged

Conversation

tausbn
Copy link
Contributor

@tausbn tausbn commented Sep 27, 2023

I was perusing the shared extractor the other day, when I came across the NodeInfo struct. I noticed that the fields and subtypes fields on this struct had two seemingly identical ways of expressing the same thing: None and Some(empty) (where empty 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! 🙂)

I was perusing the shared extractor the other day, when I came across
the `NodeInfo` struct. I noticed that the `fields` and `subtypes` fields
on this struct had two seemingly identical ways of expressing the same
thing: `None` and `Some(empty)` (where `empty` 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.
@tausbn tausbn marked this pull request as ready for review September 27, 2023 13:25
@tausbn tausbn requested a review from aibaars September 27, 2023 13:28
@tausbn tausbn merged commit ad86aed into main Sep 27, 2023
@tausbn tausbn deleted the tausbn/clean-up-nodeinfo branch September 27, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants