Uh oh!
There was an error while loading. Please reload this page.
DoubleEndedIterator and ExactSizeIterator for To*case. - #38968
DoubleEndedIterator and ExactSizeIterator for To*case.#38968clarfonthey wants to merge 1 commit into
Conversation
rust-highfive
commented
Jan 10, 2017
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
4d1f73d to
4c6a6fcCompare4c6a6fc to
1a402a5Compareclarfonthey
commented
Jan 29, 2017
Ping @brson |
alexcrichton
commented
Feb 4, 2017
I'm not sure that this is a guarantee we want to provide perhaps? Is there a motivation for this beyond just completeness? I could imagine future implementations, for example, that lazily compute future characters as opposed to buffering them all up in memory immediately as soon as the iterator is constructed. Implementing |
clarfonthey
commented
Feb 4, 2017
I will agree that shortly after I made this I thought that implementing DEI was a bit unnecessary, although I kept it in anyway. I'll remove that. ExactSizeIterator seems reasonable, though. |
alexcrichton
commented
Feb 4, 2017
Even that, though, do we get much benefit? It seems like it may preclude "interesting" future implementations maybe |
clarfonthey
commented
Feb 5, 2017
Initially my thought was that it could be used to help figure out more exact allocations for I guess that in principle, it makes sense to know how many characters are required for a lowercase form, but I'm also not sure if that's actually a strong desire. |
alexcrichton
commented
Feb 5, 2017
@brson may have more comments, but I think I personally have yet to be convinced (but certainly could be!) |
alexcrichton
commented
Feb 14, 2017
Ok we discussed this during libs triage today but the general sentiment was along the lines of what I've been saying previously which is that these are niche enough API use cases and without a concrete use case in mind we'd prefer to avoid restricting ourselves. If you've got a use case in mind for these though feel free to resubmit! |
Because the iterator itself is exact, I see no reason to not implement these traits. Sort of iffy in hindsight about
DoubleEndedIteratorbut I've offered both to see what people think.