book
book copied to clipboard
Better introduction of &str deref coercion
- [x] I have checked the latest
mainbranch to see if this has already been fixed - [x] I have searched existing issues and pull requests for duplicates
URL to the section(s) of the book with this problem: https://doc.rust-lang.org/nightly/book/ch04-03-slices.html#string-slices-as-parameters https://doc.rust-lang.org/nightly/book/ch08-02-strings.html#concatenation-with-the--operator-or-the-format-macro
Description of the problem:
- I was quite confused when I first encountered the deref coercion thing in Chapter 4.3 - String Slices As Parameters, so I raised a PR #2773 before, added a reference to Chapter 15
- I found there's also a reference to Chapter 15 in Chapter 8.2 - Concatenation with the
+Operator or theformat!Macro
So I'm thinking if there's a way to simplify these two parts, and better introduce this deref coercion feature of Rust to beginners like me.
Suggested fix:
- Add a reference to Chapter 4.3 on Chapter 8.2
- Edit the reference to Chapter 15 in Chapter 4.3, make it refer to Chapter 8.2, something like "we will discuss this later in Chapter 8 and Chapter 15"
One more reason, reference to ch15 when reading ch04 might be quite frustrating. The reader will have to read 11 more chapters to figure it out. Make a closer reference to ch08 would reduce this frustration.