From 26f571b0809512d569cb7f07ff6c3846e1ea7fe8 Mon Sep 17 00:00:00 2001 From: spotlesscoder Date: Wed, 16 Oct 2024 07:57:04 +0200 Subject: [PATCH] fix: make the reason more understandable --- 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 d01d905021..c9c97ed7a2 100644 --- a/src/ch04-03-slices.md +++ b/src/ch04-03-slices.md @@ -17,7 +17,7 @@ fn first_word(s: &String) -> ? ``` The `first_word` function has a `&String` as a parameter. We don’t want -ownership, so this is fine. But what should we return? We don’t really have a +ownership because we want to keep using the `String` after calling the `first_word` function, so this is fine. But what should we return? We don’t really have a way to talk about *part* of a string. However, we could return the index of the end of the word, indicated by a space. Let’s try that, as shown in Listing 4-7.