Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
std::iter: Introduce .by_ref() adaptor
Creates a wrapper around a mutable reference to the iterator. This is useful to allow applying iterator adaptors while still retaining ownership of the original iterator value. Example:: let mut xs = range(0, 10); // sum the first five values let partial_sum = xs.by_ref().take(5).fold(0, |a, b| a + b); assert!(partial_sum == 10); // xs.next() is now `5` assert!(xs.next() == Some(5));
- Loading branch information
blake2-ppc
committed
Sep 30, 2013
1 parent
92e7bb6
commit 8163cb5
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8163cb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from thestinger
at https://github.com/blake2-ppc/rust/commit/8163cb53903dd09e920b6267eba72793394b77d0
8163cb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging blake2-ppc/rust/by-ref-iter = 8163cb5 into auto
8163cb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blake2-ppc/rust/by-ref-iter = 8163cb5 merged ok, testing candidate = 63e097d
8163cb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/1988
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1992
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/1098
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/1097
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/2006
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/1098
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/1098
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/2007
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/1098
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/1098
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/1177
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/1991
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/1096
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/1098
success: http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/1775
8163cb5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 63e097d