diff --git a/src/ch04-03-slices.md b/src/ch04-03-slices.md index 80f4a47b5..203cd3d65 100644 --- a/src/ch04-03-slices.md +++ b/src/ch04-03-slices.md @@ -256,8 +256,10 @@ and `&str` values. a string slice for the type of the `s` parameter If we have a string slice, we can pass that directly. If we have a `String`, we -can pass a slice of the entire `String`. Defining a function to take a string -slice instead of a reference to a `String` makes our API more general and useful +can pass a slice of the entire `String`. We can also pass the reference of +`String`, thanks to [Deref Coercions][deref-coercions], a feature +we will cover later in Chapter 15. Defining a function to take a string slice +instead of a reference to a `String` makes our API more general and useful without losing any functionality: Filename: src/main.rs @@ -304,3 +306,4 @@ these concepts further throughout the rest of the book. Let’s move on to Chapter 5 and look at grouping pieces of data together in a `struct`. [strings]: ch08-02-strings.html#storing-utf-8-encoded-text-with-strings +[deref-coercions]: ch15-02-deref.html#implicit-deref-coercions-with-functions-and-methods