I\'m trying to write a program that involves filtering and folding over arrays. I\'ve been using The Rust Programming Language, first edition as a reference, but I don\'t un
As Shepmaster and bluss said, you can check the documentation for the array type, which mentions:
Arrays of sizes from 0 to 32 (inclusive) implement the following traits if the element type allows it:
IntoIterator
(implemented for&[T; N]
and&mut [T; N]
)
As it says, this is only for references, and is reflected in its Item
type: type Item = &'a T
and type Item = &'a mut T
.