diff options
| author | John Van Enk <vanenkj@gmail.com> | 2015-04-21 09:21:52 -0700 |
|---|---|---|
| committer | John Van Enk <vanenkj@gmail.com> | 2015-04-21 09:21:52 -0700 |
| commit | 5f7556cd39217a3a7f27de18d3b7366dfe591f23 (patch) | |
| tree | 130be17a4df434a47124af27c167b6cdbd6f4aff | |
| parent | 77acda1c8ee75f9eb923ddd811ee591951b2d43f (diff) | |
| download | rust-5f7556cd39217a3a7f27de18d3b7366dfe591f23.tar.gz rust-5f7556cd39217a3a7f27de18d3b7366dfe591f23.zip | |
Add an example of completely slicing an object.
| -rw-r--r-- | src/doc/trpl/primitive-types.md | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/doc/trpl/primitive-types.md b/src/doc/trpl/primitive-types.md index 811080cd509..e4af03869d1 100644 --- a/src/doc/trpl/primitive-types.md +++ b/src/doc/trpl/primitive-types.md @@ -168,6 +168,7 @@ like arrays: ```rust let a = [0, 1, 2, 3, 4]; let middle = &a[1..4]; // A slice of a: just the elements 1, 2, and 3 +let complete = &a[..]; // A slice containing all of the elements in a ``` Slices have type `&[T]`. We’ll talk about that `T` when we cover |
