From 01d6c04875e102f00a7d66a16ea09567dc7bbd97 Mon Sep 17 00:00:00 2001 From: clubby789 Date: Wed, 4 Jan 2023 02:04:31 +0000 Subject: [PATCH] Link to Option/Result for `Iterator::sum/product` --- library/core/src/iter/traits/iterator.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index fc4d4bff24f..7645e7d6f73 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -3366,6 +3366,9 @@ fn array_chunks(self) -> ArrayChunks /// /// An empty iterator returns the zero value of the type. /// + /// `sum()` can be used to sum any type implementing [`Sum`][`core::iter::Sum`], + /// including [`Option`][`Option::sum`] and [`Result`][`Result::sum`]. + /// /// # Panics /// /// When calling `sum()` and a primitive integer type is being returned, this @@ -3395,6 +3398,9 @@ fn sum(self) -> S /// /// An empty iterator returns the one value of the type. /// + /// `product()` can be used to multiply any type implementing [`Product`][`core::iter::Product`], + /// including [`Option`][`Option::product`] and [`Result`][`Result::product`]. + /// /// # Panics /// /// When calling `product()` and a primitive integer type is being returned,