Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3492a6b

Browse files
committedJul 14, 2024
Auto merge of rust-lang#127728 - matthiaskrgr:rollup-ercdbjd, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - rust-lang#127273 (Fix `DebugParser`.) - rust-lang#127587 (Report usage of lib features in ast validation) - rust-lang#127592 (doc: Suggest `str::repeat` over `iter::repeat().take().collect()`) - rust-lang#127630 (Remove lang feature for type ascription (since it's a lib feature now)) - rust-lang#127711 (Add regression test for a gce + effects ICE) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 7cd8086 + 6c4029a commit 3492a6b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎core/src/iter/sources/repeat.rs

+4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ use crate::num::NonZero;
88
/// Infinite iterators like `repeat()` are often used with adapters like
99
/// [`Iterator::take()`], in order to make them finite.
1010
///
11+
/// Use [`str::repeat()`] instead of this function if you just want to repeat
12+
/// a char/string `n`th times.
13+
///
1114
/// If the element type of the iterator you need does not implement `Clone`,
1215
/// or if you do not want to keep the repeated element in memory, you can
1316
/// instead use the [`repeat_with()`] function.
1417
///
1518
/// [`repeat_with()`]: crate::iter::repeat_with
19+
/// [`str::repeat()`]: ../../std/primitive.str.html#method.repeat
1620
///
1721
/// # Examples
1822
///

0 commit comments

Comments
 (0)
Failed to load comments.