We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2e78d37 + f82276d commit 8b51b8fCopy full SHA for 8b51b8f
src/doc/reference.md
@@ -3351,12 +3351,17 @@ heap.
3351
A slice is a 'view' into an array. It doesn't own the data it points
3352
to, it borrows it.
3353
3354
-An example of each kind:
+Examples:
3355
3356
```{rust}
3357
-let vec: Vec<i32> = vec![1, 2, 3];
3358
-let arr: [i32; 3] = [1, 2, 3];
3359
-let s: &[i32] = &vec[..];
+// A stack-allocated array
+let array: [i32; 3] = [1, 2, 3];
+
3360
+// A heap-allocated array
3361
+let vector: Vec<i32> = vec![1, 2, 3];
3362
3363
+// A slice into an array
3364
+let slice: &[i32] = &vector[..];
3365
```
3366
3367
As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The
0 commit comments