,
+ {
+ self.into_iter().sum()
+ }
+
+ /// Shorthand for `.into_iter().product()`
+ ///
+ /// See [`Iterator::product`]
+ #[stable(feature = "new_range", since = "1.0.0")]
+ pub fn product(self) -> P
+ where
+ P: crate::iter::Product,
{
- self.spec_try_rfold(init, f)
+ self.into_iter().product()
}
- impl_fold_via_try_fold! { rfold -> try_rfold }
+ /// Shorthand for `.into_iter().cmp(...)`
+ ///
+ /// See [`Iterator::cmp`]
+ #[stable(feature = "new_range", since = "1.0.0")]
+ pub fn cmp(self, other: I) -> Ordering
+ where
+ I: IntoIterator