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
Updated example code in the documentation #36746
Conversation
An example code was truncated to only its first line. I went to find the missing part in the source code of Rust, and now the documentation makes sense.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
The intention here was to show the type signature, not the implementation. Maybe we can fix it some other way to make it clear without showing the internals? |
But if you read the text right after, it looked like the reader was expected to see that the implementation was returning the iterator directly while it was not visible before the fix. |
Could we maybe instead change the above sentence to say something like "look at the type signature of this implementation"? Would that make it more clear? the body is just a distraction. |
The text around this modification is :
In my humble uninformed reader's experience (because I read it as a beginner learning Rust), it makes sense to show the implementation (the function returning I suggest to simplify the example by replacing the lines:
by |
I really do not want to write out the implementation here, sorry. I know that it may aid your understanding, but I don't want to expose internals like this, as a general rule. The source is still there to look at, in the end. Thank you for the PR, but I don't think I can accept it. |
An example code was truncated to only its first line. I went to find the missing part in the source code of Rust, and now the documentation makes sense.