Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarified first slices paragraph #3363

Merged
merged 3 commits into from
Apr 19, 2024
Merged
Changes from 2 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
7 changes: 4 additions & 3 deletions src/ch04-03-slices.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
## The Slice Type

*Slices* let you reference a contiguous sequence of elements in a collection
rather than the whole collection. A slice is a kind of reference, so it does
not have ownership.
*Slices* are a kind of reference, which lets you access a contiguous sub-sequence
of elements in a sequential [collection](ch08-00-common-collections.md).
Because slices are a kind of reference, they too can borrow access to memory, but
not own it.
chriskrycho marked this conversation as resolved.
Show resolved Hide resolved

Here’s a small programming problem: write a function that takes a string of
words separated by spaces and returns the first word it finds in that string.
Expand Down