Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add methods to go from a slice iterators to a slice.
A slice iterator is isomorphic to a slice, just with a slightly different form: storing start and end pointers rather than start pointer and length. This patch reflects this by making converting between them as easy as `iter.as_slice()` (or even `iter[]` if the shorter lifetime is ok). That is, `slice.iter().as_slice() == slice`.
- Loading branch information
Showing
2 changed files
with
145 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
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
b86a780
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 aturon
at huonw@b86a780
b86a780
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 huonw/rust/iter2slice = b86a780 into auto
b86a780
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.
huonw/rust/iter2slice = b86a780 merged ok, testing candidate = 0c1d853
b86a780
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/2441
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/2438
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/2431
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/2438
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/2432
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/2431
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/2431
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/2435
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/2428
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/2427
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2430
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/2092
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/2088
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/2094
success: http://buildbot.rust-lang.org/builders/auto-win-64-opt/builds/931
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-t/builds/925
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-c/builds/920
b86a780
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 = 0c1d853