Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for converting slice iterators to slices #27775
Comments
alexcrichton
added
T-libs
B-unstable
E-easy
labels
Aug 12, 2015
This comment has been minimized.
This comment has been minimized.
|
I kinda like this method, though I admit I’ve never actually used it :) This method is probably the simplest way to expose safely something isomorphic to the private fields of the slice iterators (a pair of pointers). All sorts of interesting things that we have not foreseen could be built on top of it outside of If this method is removed without a replacement, there is no way to get at the full information that is carried by On the other hand, what’s the cost of keeping it? Are there issues with it? |
This comment has been minimized.
This comment has been minimized.
|
This feature is now entering its final comment period for deprecation |
alexcrichton
added
the
final-comment-period
label
Aug 14, 2015
This comment has been minimized.
This comment has been minimized.
|
Note that I agree with @SimonSapin that these methods seem harmless and appealing... even if, like @SimonSapin, I haven't used them myself :) |
This comment has been minimized.
This comment has been minimized.
|
@aturon, I disagree because IntoIter & into vec are useful where drain isn't. I've got a usecase for IntoIter and I'd like to cycle out the IntoIterators and use their allocations again, after they are emptied.. |
This comment has been minimized.
This comment has been minimized.
|
@bluss Right, but my point is, |
This comment has been minimized.
This comment has been minimized.
|
@SimonSapin I like your viewpoint. Going back and forth between slices and iterators allows working with them in a kind of random access way, without having to separately count the steps you do in "iterator mode". |
This comment has been minimized.
This comment has been minimized.
jan-hudec
commented
Aug 19, 2015
|
Where these functions would be extremely useful is for strings, but I don't see them there. Basically many string operations require |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
I’ll submit a PR to add it. |
This comment has been minimized.
This comment has been minimized.
|
I guess |
alexcrichton commentedAug 12, 2015
This is a tracking issue for the unstable
iter_to_slicefeature in the standard library. Theinto_vecadaptor forvec::IntoIterwas recently removed, and these may also want to be removed. It's somewhat unclear how useful it is to have iterators enhanced with this kind of functionality.