Decision
Something is happening there. First working code:
for &(i, c) in &adjacent { }
The following is a more detailed explanation.
Problem
&(i8, i8), . (i, c). , ; . , & , , .
:
<anon>:11:5: 11:42 error: type mismatch resolving `<core::slice::Iter<'_, (i8, i8)> as core::iter::Iterator>::Item == (_, _)`:
expected &-ptr,
found tuple [E0271]
<anon>:11 for (i, c) in adjacent.into_iter() {}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
, : . , (, core::slice::Iter<'_, (i8, i8)>) , - "" (, <core::iter::Iterator>::Item == (_, _)).
"" (_, _), , , : (i, c). ? , , Iterator type Item = &'a T. 'a , T. , T, : core::slice::Iter<'_, (i8, i8)>. , T - (i8, i8), &(i8, i8).
IntoIterator
.into_iterator() . , : for _ in adjacent
the trait `core::iter::Iterator` is not implemented for the type `[(i8, i8); 8]`
: 8? , , , for.
"", , Iterator , IntoIterator. (, Vec,...) Iterator , IntoIterator. array IntoIterator - . , , IntoIterator:
impl<'a, T> IntoIterator for &'a [T; 8]
type Item = &'a T
impl<'a, T> IntoIterator for &'a mut [T; 8]
type Item = &'a mut T
, , . Item. , IntoIterator for [T; 8] ? .
, &adjacent adjacent - . . into_iterator? ... , : . .
TL; DR: adjacent - (array, Vec,...), :
for _ in &adjacent: . , !for _ in &mut adjacent: , , .for _ in adjacent: , , . ! .