-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
make the borrowing example more concrete #32991
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (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. |
I'm a bit concerned about overcomplicating it, since this is a crucial section of the book. |
Being a beginner myself, the original example looks dull to me. Pass two references into a function, and then do nothing with it? Then what's the point in passing them in the first place? It's just intellectually very unsatisfying. In the modified example, the reader can immediately see that some work is done with these references. The machineries, which are a bit more involved, are hidden behind another function, and the reader doesn't need to understand it at this stage, but they can always look back when they want. |
Bear in mind that not everyone approaches Rust with the same level of understanding, so "intellectually satisfying" is less priority than everyone being able to understand. 😄 "do stuff with v1 and v2" already indicates that the function is going to do something, but it's elided for the purposes of simplicity. I'm okay with additional examples, but I'd like there to be at least one simple example without much going on that clearly demonstrates the point. |
Yes, this section needs to be very simple, even if it's a bit dry. Also worth noting that I've completely re-done all of this in the new book, so it's gonna eventually be replaced anyway. So, I share @Manishearth 's concern here. What about adding this as second example, after the original one as the first? |
Ok, that's fine. |
@kindlychung great! Please ping me when you have the time to do it :) |
add as 2nd example.
@steveklabnik Done. |
@bors: r+ rollup thanks! :) |
📌 Commit 10abb66 has been approved by |
make the borrowing example more concrete
make the borrowing example more concrete
No description provided.