Skip to content

Commit 049b587

Browse files
committed
Minor tweaks to Iterator's docs
1 parent 7c96085 commit 049b587

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ pub trait DoubleEndedIterator: Iterator {
225225
/// // available through the iterator.
226226
/// assert_eq!(it.next_back(), Some(&"1"));
227227
/// ```
228+
#[doc(alias = "try_foldr")]
228229
#[inline]
229230
#[stable(feature = "iterator_try_fold", since = "1.27.0")]
230231
fn try_rfold<B, F, R>(&mut self, init: B, mut f: F) -> R
@@ -351,6 +352,7 @@ pub trait DoubleEndedIterator: Iterator {
351352
/// // we can still use `iter`, as there are more elements.
352353
/// assert_eq!(iter.next_back(), Some(&1));
353354
/// ```
355+
#[doc(alias = "findr")]
354356
#[inline]
355357
#[stable(feature = "iter_rfind", since = "1.27.0")]
356358
fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -1358,6 +1358,7 @@ pub trait Iterator {
13581358
/// ```
13591359
///
13601360
/// [`by_ref`]: Iterator::by_ref
1361+
#[doc(alias = "limit")]
13611362
#[inline]
13621363
#[stable(feature = "rust1", since = "1.0.0")]
13631364
fn take(self, n: usize) -> Take<Self>
@@ -2389,6 +2390,7 @@ pub trait Iterator {
23892390
/// });
23902391
/// assert_eq!(triangular, ControlFlow::Continue(435));
23912392
/// ```
2393+
#[doc(alias = "try_lfold", alias = "try_foldl")]
23922394
#[inline]
23932395
#[stable(feature = "iterator_try_fold", since = "1.27.0")]
23942396
fn try_fold<B, F, R>(&mut self, init: B, mut f: F) -> R
@@ -2565,7 +2567,7 @@ pub trait Iterator {
25652567
/// ```
25662568
///
25672569
/// [`reduce()`]: Iterator::reduce
2568-
#[doc(alias = "inject", alias = "foldl")]
2570+
#[doc(alias = "inject", alias = "lfold", alias = "foldl")]
25692571
#[inline]
25702572
#[stable(feature = "rust1", since = "1.0.0")]
25712573
fn fold<B, F>(mut self, init: B, mut f: F) -> B
@@ -2848,6 +2850,7 @@ pub trait Iterator {
28482850
/// ```
28492851
///
28502852
/// Note that `iter.find(f)` is equivalent to `iter.filter(f).next()`.
2853+
#[doc(alias = "lfind", alias = "findl")]
28512854
#[inline]
28522855
#[stable(feature = "rust1", since = "1.0.0")]
28532856
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>

library/core/src/str/lossy.rs

+2
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,14 @@ impl fmt::Debug for Debug<'_> {
147147
/// An iterator used to decode a slice of mostly UTF-8 bytes to string slices
148148
/// ([`&str`]) and byte slices ([`&[u8]`][byteslice]).
149149
///
150+
/// This struct is created by the [`utf8_chunks`] method on bytes slices.
150151
/// If you want a simple conversion from UTF-8 byte slices to string slices,
151152
/// [`from_utf8`] is easier to use.
152153
///
153154
/// See the [`Utf8Chunk`] type for documentation of the items yielded by this iterator.
154155
///
155156
/// [byteslice]: slice
157+
/// [`utf8_chunks`]: slice::utf8_chunks
156158
/// [`from_utf8`]: super::from_utf8
157159
///
158160
/// # Examples

0 commit comments

Comments
 (0)