You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ch04-03-slices.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ fn first_word(s: &String) -> ?
17
17
```
18
18
19
19
The `first_word` function has a `&String` as a parameter. We don’t want
20
-
ownership, so this is fine. But what should we return? We don’t really have a
20
+
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
21
21
way to talk about *part* of a string. However, we could return the index of the
22
22
end of the word, indicated by a space. Let’s try that, as shown in Listing 4-7.
0 commit comments