@@ -8,11 +8,15 @@ use crate::num::NonZero; |
|
|
8 |
8 |
/// Infinite iterators like `repeat()` are often used with adapters like |
9 |
9 |
/// [`Iterator::take()`], in order to make them finite. |
10 |
10 |
/// |
|
11 |
+/// Use [`str::repeat()`] instead of this function if you just want to repeat |
|
12 |
+/// a char/string `n`th times. |
|
13 |
+/// |
11 |
14 |
/// If the element type of the iterator you need does not implement `Clone`, |
12 |
15 |
/// or if you do not want to keep the repeated element in memory, you can |
13 |
16 |
/// instead use the [`repeat_with()`] function. |
14 |
17 |
/// |
15 |
18 |
/// [`repeat_with()`]: crate::iter::repeat_with |
|
19 |
+/// [`str::repeat()`]: ../../std/primitive.str.html#method.repeat |
16 |
20 |
/// |
17 |
21 |
/// # Examples |
18 |
22 |
/// |