From 5f7556cd39217a3a7f27de18d3b7366dfe591f23 Mon Sep 17 00:00:00 2001 From: John Van Enk Date: Tue, 21 Apr 2015 09:21:52 -0700 Subject: [PATCH] Add an example of completely slicing an object. --- src/doc/trpl/primitive-types.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/doc/trpl/primitive-types.md b/src/doc/trpl/primitive-types.md index 811080cd5098..e4af03869d1d 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