#4816·book

string slices phrasing, ch04-03

Author: phgzCreated Aug 25, 2026Updated Aug 25, 2026
  • I have searched open and closed issues and pull requests for duplicates, using these search terms:

    • slice
  • I have checked the latest main branch to see if this has already been fixed, in this file:

    • n/a

URL to the section(s) of the book with this problem: https://doc.rust-lang.org/book/ch04-03-slices.html#string-slices-as-parameters

Description of the problem: Below listing 4.9, it says: "If we have a String, we can pass a slice of the String or a reference to the String.", then on the next paragraph: "Defining a function to take a string slice instead of a reference to a String makes [...]".

Suggested fix: The "instead of" is confusing, because it CAN accept a reference to a string. Maybe cut that last part, or specify: "Defining a function to take a string slice can accept both string slices and string references". Or otherwise: "Defining a function with a string slice parameter instead of [...]".