Skip to content

Commit

Permalink
Fix Iterator::fuse example
Browse files Browse the repository at this point in the history
The for loop would *always* exaust the iterator previously, which seems
like behavior that was not intended. It's still kind of a weird
function.
  • Loading branch information
sfackler committed Sep 26, 2014
1 parent e31680a commit a4844a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libcore/iter.rs
Expand Up @@ -366,7 +366,7 @@ pub trait Iterator<A> {
/// let mut sum = 0;
/// for x in it {
/// if x > 5 {
/// continue;
/// break;
/// }
/// sum += x;
/// }
Expand All @@ -377,6 +377,8 @@ pub trait Iterator<A> {
/// sum
/// }
/// let x = vec![1i,2,3,7,8,9];
/// assert_eq!(process(x.into_iter()), 6);
/// let x = vec![1i,2,3];
/// assert_eq!(process(x.into_iter()), 1006);
/// ```
#[inline]
Expand Down

0 comments on commit a4844a6

Please sign in to comment.