diff options
| author | clubby789 <jamie@hill-daniel.co.uk> | 2023-01-04 02:04:31 +0000 |
|---|---|---|
| committer | clubby789 <jamie@hill-daniel.co.uk> | 2023-01-04 15:54:02 +0000 |
| commit | 01d6c04875e102f00a7d66a16ea09567dc7bbd97 (patch) | |
| tree | 2f62390a62414002919c282ca217f0d084c76eea | |
| parent | c7572670a1302f5c7e245d069200e22da9df0316 (diff) | |
| download | rust-01d6c04875e102f00a7d66a16ea09567dc7bbd97.tar.gz rust-01d6c04875e102f00a7d66a16ea09567dc7bbd97.zip | |
Link to Option/Result for `Iterator::sum/product`
| -rw-r--r-- | library/core/src/iter/traits/iterator.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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 @@ pub trait Iterator { /// /// 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 @@ pub trait Iterator { /// /// 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, |
