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
6 changes: 3 additions & 3 deletions src/ch04-03-slices.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,13 @@ part of an array. We’d do so like this:
```rust
let a = [1, 2, 3, 4, 5];

let slice = &a[1..3];
let slice = &a[2..4];

assert_eq!(slice, &[2, 3]);
assert_eq!(slice, &[3, 4]);
```

This slice has the type `&[i32]`. It works the same way as string slices do, by
storing a reference to the first element and a length. You’ll use this kind of
storing a reference to its first element and a length. You’ll use this kind of
slice for all sorts of other collections. We’ll discuss these collections in
detail when we talk about vectors in Chapter 8.

Expand Down