|
$ rustc arrays.rs
$ ./arrays
arr_inferred: [1, 2, 3, 4, 5]
arr_explicit: [1, 2, 3, 4, 5]
arr_same: [3, 3, 3, 3, 3]
arr_2d: [[1, 2, 3], [4, 5, 6]]
first: 1, second: 2
third: 3
arr: [10, 2, 3, 4, 5]
size: 5
slice: [2, 3]
rest: [2, 3, 4, 5]
all: [10, 2, 3, 4, 5]
element: 10
element: 2
element: 3
element: 4
element: 5
index: 0, element: 10
index: 1, element: 2
index: 2, element: 3
index: 3, element: 4
index: 4, element: 5
index: 0, element: 10
index: 1, element: 2
index: 2, element: 3
index: 3, element: 4
index: 4, element: 5
|