From 259e59423ec41af704ca682f2035cc8fc0921b69 Mon Sep 17 00:00:00 2001 From: Lewis Belcher Date: Sun, 14 Apr 2019 13:43:23 +0200 Subject: [PATCH] Update ch04-03-slices.md `&str` parameter works for `&String` not `String` (likely just a typo). --- src/ch04-03-slices.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch04-03-slices.md b/src/ch04-03-slices.md index de12cee576..2c791a46b9 100644 --- a/src/ch04-03-slices.md +++ b/src/ch04-03-slices.md @@ -311,7 +311,7 @@ fn first_word(s: &String) -> &str { ``` A more experienced Rustacean would write the signature shown in Listing 4-9 -instead because it allows us to use the same function on both `String` values +instead because it allows us to use the same function on both `&String` values and `&str` values. ```rust,ignore