Skip to content

Commit 01d6c04

Browse files
committed
Link to Option/Result for Iterator::sum/product
1 parent c757267 commit 01d6c04

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/core/src/iter/traits/iterator.rs

+6
Original file line numberDiff line numberDiff line change
@@ -3366,6 +3366,9 @@ pub trait Iterator {
33663366
///
33673367
/// An empty iterator returns the zero value of the type.
33683368
///
3369+
/// `sum()` can be used to sum any type implementing [`Sum`][`core::iter::Sum`],
3370+
/// including [`Option`][`Option::sum`] and [`Result`][`Result::sum`].
3371+
///
33693372
/// # Panics
33703373
///
33713374
/// When calling `sum()` and a primitive integer type is being returned, this
@@ -3395,6 +3398,9 @@ pub trait Iterator {
33953398
///
33963399
/// An empty iterator returns the one value of the type.
33973400
///
3401+
/// `product()` can be used to multiply any type implementing [`Product`][`core::iter::Product`],
3402+
/// including [`Option`][`Option::product`] and [`Result`][`Result::product`].
3403+
///
33983404
/// # Panics
33993405
///
34003406
/// When calling `product()` and a primitive integer type is being returned,

0 commit comments

Comments
 (0)