From f324ae2bbc5a96aabeb53e2418992ff6110e4473 Mon Sep 17 00:00:00 2001 From: MohammadHosein Masoon Date: Thu, 6 Feb 2025 14:14:12 +0330 Subject: [PATCH] make the possible error message more similar to the compiler error message --- book/src/04_traits/07_deref.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/src/04_traits/07_deref.md b/book/src/04_traits/07_deref.md index 9b65664fcc..b2a98d3165 100644 --- a/book/src/04_traits/07_deref.md +++ b/book/src/04_traits/07_deref.md @@ -33,7 +33,7 @@ Let's review the facts: - `&self.title` is, therefore, a `&String` - The output of the (modified) `title` method is `&str` -You would expect a compiler error, wouldn't you? `Expected &String, found &str` or something similar. +You would expect a compiler error, wouldn't you? `Expected &str, found &String` or something similar. Instead, it just works. **Why**? ## `Deref` to the rescue