Skip to content

Commit

Permalink
fix: make the reason more understandable
Browse files Browse the repository at this point in the history
  • Loading branch information
spotlesscoder authored Oct 16, 2024
1 parent 1cbfc5c commit 8ef3399
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ch04-03-slices.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 8ef3399

Please sign in to comment.