@@ -333,21 +333,22 @@ pub trait Iterator {
333
333
/// regardless of the step given.
334
334
///
335
335
/// Note 2: The time at which ignored elements are pulled is not fixed.
336
- /// `StepBy` behaves like the sequence `next(), nth(step-1), nth(step-1), …`,
337
- /// but is also free to behave like the sequence
338
- /// `advance_n_and_return_first(step), advance_n_and_return_first(step), …`
336
+ /// `StepBy` behaves like the sequence `self.next()`, `self.nth(step-1)`,
337
+ /// `self.nth(step-1)`, …, but is also free to behave like the sequence
338
+ /// `advance_n_and_return_first(&mut self, step)`,
339
+ /// `advance_n_and_return_first(&mut self, step)`, …
339
340
/// Which way is used may change for some iterators for performance reasons.
340
341
/// The second way will advance the iterator earlier and may consume more items.
341
342
///
342
343
/// `advance_n_and_return_first` is the equivalent of:
343
344
/// ```
344
- /// fn advance_n_and_return_first<I>(iter: &mut I, total_step : usize) -> Option<I::Item>
345
+ /// fn advance_n_and_return_first<I>(iter: &mut I, n : usize) -> Option<I::Item>
345
346
/// where
346
347
/// I: Iterator,
347
348
/// {
348
349
/// let next = iter.next();
349
- /// if total_step > 1 {
350
- /// iter.nth(total_step- 2);
350
+ /// if n > 1 {
351
+ /// iter.nth(n - 2);
351
352
/// }
352
353
/// next
353
354
/// }
0 commit comments