-
Notifications
You must be signed in to change notification settings - Fork 13.6k
rustdoc_json: more conversion cleanups #142896
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
base: master
Are you sure you want to change the base?
rustdoc_json: more conversion cleanups #142896
Conversation
No point computing these when they're only needed for one or two of the match arms.
For consistency with most other types.
Re-rolling, as I have very limited review capacity at the moment, and this isn't particularly impactful/is more of a style thing that needing specific expertise. r? rustdoc |
It has been a month since this was filed and two weeks since it was reassigned. Let's try another reviewer for this small change. |
Interestingly enough, this is doing the opposite of what we did in the rest of rustdoc: replacing functions with trait implementations. We found it too complicated to keep track of the contexts/types when everything is just trait method calls and instead replaced that with plain function calls, making it easier to understand what was happening and also making it easier to be able to find the conversion code based on the function's name. Maybe some extra insight on why we should finish this cleanup? #142747 was already merged after all but I'm not super enthusiast about this. |
It was a mix of trait methods and functions before. That seemed sub-optimal. The methods (a) were used more than functions, and (b) produce more concise and uniform code at the use points, so I converted a bunch of the functions to methods for consistency. But I won't fight for this to go in if there is opposition, it's not that important. |
I'll let @aDotInTheVoid have the final word here. |
A follow-up to #142747.
r? @aDotInTheVoid