From c1a3c873e2bb02f1ea537245a1f73608e55ac4e4 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Fri, 10 Sep 2021 10:50:35 +0000 Subject: [PATCH] Clarify deref coercion converts reference to a type --- src/ch15-02-deref.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch15-02-deref.md b/src/ch15-02-deref.md index 1daa39ddb..8c341958f 100644 --- a/src/ch15-02-deref.md +++ b/src/ch15-02-deref.md @@ -183,7 +183,7 @@ Listing 15-9. *Deref coercion* is a convenience that Rust performs on arguments to functions and methods. Deref coercion works only on types that implement the `Deref` -trait. Deref coercion converts such a type into a reference to another type. +trait. Deref coercion converts reference to such a type into a reference to another type. For example, deref coercion can convert `&String` to `&str` because `String` implements the `Deref` trait such that it returns `&str`. Deref coercion happens automatically when we pass a reference to a particular type’s value as an