-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Improve Local SystemParam text, examples #21718
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
ffab449 to
d4b95e7
Compare
alice-i-cecile
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.
A few suggestions, but I like the direction of this :)
|
Review comments addressed. Also saw a comment in one example that was meant to be deleted after a copy/paste. Also added another example about using locals to save on reallocations. Do need an opinion on whether it's a good example or not. |
I really like this: it's a common and useful pattern. |
Zeophlite
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.
Nice
Objective
Explain
Local<T>better to newbies.Solution
Add more examples of how to use
Local<T>and document howTis initialized for this type.I tried to order the examples from basic information to more niche information.
I have no clue if the configuration example is useful or even what it's trying to convey. The blame log shows that there was some configuration thing that was removed.
Furthermore, I added a doc comment to the SystemParam impl giving a very short description of what it provides as a system parameter. I think all non-tuple impls should provide such a blurb so that looking at the implementations for the trait itself provides useful information besides just the name. If that is wanted, an issue should be opened for it. If it is not, either I or the reviewer who commits this can remove the line.
Testing
I ran the doctests. I also built the docs and checked that the links work.