rust/library/alloc
Jonas Schievink 738a41b363
Rollup merge of #77449 - ssomers:btree_drain_filter_size_hint, r=Mark-Simulacrum
BTreeMap: comment why drain_filter's size_hint is somewhat pessimistic

The `size_hint` of the `DrainFilter` iterator doesn't adjust as you iterate. This hardly seems important to me, but there has been a comparable PR #64383 in the past. I guess a scenario is that you first iterate half the map manually and keep most of the key/value pairs in the map, and then tell the predicate to drain most of the key/value pairs and `.collect` the iterator over the remaining half of the map.

I am totally ambivalent whether this is better or not.

r? @Mark-Simulacrum
2020-10-08 23:23:08 +02:00
..
benches Rust vec bench import specific rand::RngCore 2020-09-25 22:19:28 +08:00
src Rollup merge of #77449 - ssomers:btree_drain_filter_size_hint, r=Mark-Simulacrum 2020-10-08 23:23:08 +02:00
tests Auto merge of #74194 - mbrubeck:slice-eq, r=sfackler 2020-10-07 01:20:11 +00:00
Cargo.toml