From 8ef33990cc3ac8e44ba2773eb232c63ed446037e 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..10af81f633 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 use the `String` in the function 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.