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