Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/ch04-03-slices.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ let slice = &s[..];
> multibyte character, your program will exit with an error.

With all this information in mind, let’s rewrite `first_word` to return a
slice. The type that signifies “string slice” is written as `&str`:
slice. Note for the below code that `*` usually dereferences a reference in expressions,
while `&` in a pattern matches a reference and automatically unwraps its value.
The type that signifies “string slice” is written as `&str`:

<Listing file-name="src/main.rs">

Expand Down