]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #33849 - ranma42:escape-iters-count, r=alexcrichton
authorManish Goregaokar <manishsmail@gmail.com>
Sat, 28 May 2016 14:22:16 +0000 (19:52 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Sat, 28 May 2016 14:22:16 +0000 (19:52 +0530)
commit6e897d78ae41872ab311aa76dcf856a707b66250
treecda0a2ec15b1d7a47ec33b6cb2a11730ba8dc65f
parent320dd04fabf1d3351efa00446bc9c36d5c6c5ef3
parent6b5e86b0ce543c60e201f95d57d720181281f1da
Rollup merge of #33849 - ranma42:escape-iters-count, r=alexcrichton

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 #24214, split from #31049.

The test for `count` was added in #33103.