diff options
| author | Kevin Reid <kpreid@google.com> | 2021-06-16 17:52:33 -0700 |
|---|---|---|
| committer | Kevin Reid <kpreid@google.com> | 2021-06-16 17:52:33 -0700 |
| commit | cb2f8d9b027f01fb29487e8852d2ddb1c71ea57b (patch) | |
| tree | ccc6181f98b8e29dd6a13380919fd1df08412417 | |
| parent | a85f584aebd9b08314bf30b9adc17b4a752143e5 (diff) | |
| download | rust-cb2f8d9b027f01fb29487e8852d2ddb1c71ea57b.tar.gz rust-cb2f8d9b027f01fb29487e8852d2ddb1c71ea57b.zip | |
Make `sum()` and `product()` hyperlinks refer to `Iterator` methods.
The previous linking seemed confusing: within "the sum() method on iterators", "sum()" was linked to `Sum::sum`, not `Iterator::sum`, even though the sentence is talking about the latter. I have rewritten the sentence to be, I believe, clearer, as well as changing the link destinations; applying the same change to the `Product` documentation as well as `Sum`.
| -rw-r--r-- | library/core/src/iter/traits/accum.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/library/core/src/iter/traits/accum.rs b/library/core/src/iter/traits/accum.rs index 0a4210a78e3..c2e837df5ff 100644 --- a/library/core/src/iter/traits/accum.rs +++ b/library/core/src/iter/traits/accum.rs @@ -3,12 +3,11 @@ use crate::num::Wrapping; /// Trait to represent types that can be created by summing up an iterator. /// -/// This trait is used to implement the [`sum()`] method on iterators. Types which -/// implement the trait can be generated by the [`sum()`] method. Like -/// [`FromIterator`] this trait should rarely be called directly and instead -/// interacted with through [`Iterator::sum()`]. +/// This trait is used to implement [`Iterator::sum()`]. Types which implement +/// this trait can be generated by using the [`sum()`] method on an iterator. +/// Like [`FromIterator`], this trait should rarely be called directly. /// -/// [`sum()`]: Sum::sum +/// [`sum()`]: Iterator::sum /// [`FromIterator`]: iter::FromIterator #[stable(feature = "iter_arith_traits", since = "1.12.0")] pub trait Sum<A = Self>: Sized { @@ -21,12 +20,11 @@ pub trait Sum<A = Self>: Sized { /// Trait to represent types that can be created by multiplying elements of an /// iterator. /// -/// This trait is used to implement the [`product()`] method on iterators. Types -/// which implement the trait can be generated by the [`product()`] method. Like -/// [`FromIterator`] this trait should rarely be called directly and instead -/// interacted with through [`Iterator::product()`]. +/// This trait is used to implement [`Iterator::product()`]. Types which implement +/// this trait can be generated by using the [`product()`] method on an iterator. +/// Like [`FromIterator`], this trait should rarely be called directly. /// -/// [`product()`]: Product::product +/// [`product()`]: Iterator::product /// [`FromIterator`]: iter::FromIterator #[stable(feature = "iter_arith_traits", since = "1.12.0")] pub trait Product<A = Self>: Sized { |
