Implement last for EscapeUnicode#33103
Merged
bors merged 2 commits intorust-lang:masterfrom May 20, 2016
Merged
Conversation
Contributor
|
(rust_highfive has picked a reviewer for you, use r? to override) |
Member
|
Thanks! Could you add a few tests for this as well? |
Member
@ranma42 ping, in case you missed the original request by Alex (this happens to me way too often). |
Contributor
Author
|
Thanks for the heads-up! |
Contributor
Author
|
@alexcrichton ping-back ;) |
Member
bors
added a commit
that referenced
this pull request
May 19, 2016
Implement `last` for `EscapeUnicode`
The implementation is quite trivial as the last character is always `'{'`.
As a side-effect it also improves the implementation of `last` for `EscapeUnicode`.
Part of #24214, split from #31049.
Maybe this (and the other changes that I will split from #31049) should wait for a test like `ed_iterator_specializations` to be added. Would it be sufficient to do the same for each possible escape length?
Collaborator
Collaborator
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
May 28, 2016
…richton Implement `count` for `EscapeUnicode` and cleanup the code for `count` for `EscapeDefault` (instead of repeating the `match` for `size_hint` and `count`). This PR marks EscapeUnicode and EscapeDefault as ExactSizeIterator. The constraints for the trait implementations held even before this PR, but I am not sure if this is something we want to guarantee/expose (I would love feedback on this, especially on what would be the appropriate way to handle stabilisation, if needed). Part of rust-lang#24214, split from rust-lang#31049. The test for `count` was added in rust-lang#33103.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The implementation is quite trivial as the last character is always
'{'.As a side-effect it also improves the implementation of
lastforEscapeUnicode.Part of #24214, split from #31049.
Maybe this (and the other changes that I will split from #31049) should wait for a test like
ed_iterator_specializationsto be added. Would it be sufficient to do the same for each possible escape length?