-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Mention about mem::replace, Option::replace and Option::take #4163
Comments
Thanks for the suggestion. These are the APIs which caught your attention, and quite rightly: they’re important and useful! There are equally important APIs that would catch someone else’s attention, though, and so on ad infinitum. As noted over on #4104, we have a more general challenge here of figuring out where to document key parts of the language, still less how to help people learn what APIs exist—but this book, for good and for ill, just cannot cover everything! Footnotes
|
Btw, it's a great book, I've enjoyed it a lot, read it all and will read it again. Agree, sorry for
Given that this is a very common idiom, I think it would help to include it in the book, but only if you feel better. I'm also trying to write a book https://docs.google.com/document/d/1sInnf4umYPBi_zSmKKF4k4w8TJ7jVldUwoV9bOsERM4/edit?usp=sharing would help me to give me some feedback :) |
As I said, there are many very common idioms we do not discuss in the book. We just cannot—there is not enough room to cover everything while still working as an introduction to the language. Happily, there are great resources like the one you linked there which cover many of the things we cannot cover for length reasons! Good luck on your own book effort! |
Thank you, I would appreciate it if you could give me some feedback and advice, as you clearly have experience in writing a book. You can send it to radumarias@gmail.com. Thank you. |
I have searched open and closed issues and pull requests for duplicates, using these search terms:
I have checked the latest
main
branch to see if this has already been fixed, in this file:URL to the section(s) of the book with this problem:
Description of the problem:
No mention about mem::replace, Option::replace and Option::take.
Also about swap.
Suggested fix:
Would have been great to mention about mem::replace and Option::replace and Option::take as they are very used later on, especially in https://rust-unofficial.github.io/too-many-lists/ and they are very useful.
The text was updated successfully, but these errors were encountered: