We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
str::repeat
iter::repeat().take().collect()
1 parent 0c81f94 commit 3f38594Copy full SHA for 3f38594
library/core/src/iter/sources/repeat.rs
@@ -7,6 +7,9 @@ use crate::num::NonZero;
7
///
8
/// Infinite iterators like `repeat()` are often used with adapters like
9
/// [`Iterator::take()`], in order to make them finite.
10
+///
11
+/// > Please prefer [`str::repeat()`] over this function if you just want
12
+/// > to repeat a char/string `n`th times.
13
14
/// If the element type of the iterator you need does not implement `Clone`,
15
/// or if you do not want to keep the repeated element in memory, you can
0 commit comments