Repository: rust-itertools/itertools (language: rust)

Issue:
`ConsTuples::next_back` is plain wrong
I was re-considering specialize `ConsTuples::rfold` for #755 when I saw something obviously wrong:
https://github.com/rust-itertools/itertools/blob/f60fe7e9548ffb047420c3d9ec576aa792d8e9ca/src/cons_tuples_impl.rs#L26-L32

**`self.iter.next()` instead of `self.iter.next_back()` is one obvious bug here!**

`ConsTuples` is an internal detail of the `iproduct` macro and the cartesian product does not implement `DoubleEndedIterator` (and it can't as currently defined) so this is not used inside the crate (and won't).
No one noticed (in 8 years) such an obvious error so it's very unlikely used outside of itertools, right?

I suggest we _remove the implementation_ (breaking change?).
Or we could fix it, add a test (and specialize `rfold`).


Discussion / hints:

Fix patch:
diff --git a/src/cons_tuples_impl.rs b/src/cons_tuples_impl.rs
index 3cae0b06e..9ab309478 100644
--- a/src/cons_tuples_impl.rs
+++ b/src/cons_tuples_impl.rs
@@ -21,16 +21,6 @@ macro_rules! impl_cons_iter(
                 self.iter.fold(accum, move |acc, (($($B,)*), x)| f(acc, ($($B,)* x, )))
             }
         }
-
-        #[allow(non_snake_case)]
-        impl<X, Iter, $($B),*> DoubleEndedIterator for ConsTuples<Iter, (($($B,)*), X)>
-            where Iter: DoubleEndedIterator<Item = (($($B,)*), X)>,
-        {
-            fn next_back(&mut self) -> Option<Self::Item> {
-                self.iter.next().map(|(($($B,)*), x)| ($($B,)* x, ))
-            }
-        }
-
     );
 );
 


Test patch: