]> git.lizzy.rs Git - rust.git/commit
Fully generalize `BTree{Map, Set}` range iterators
authorAndrew Paseltiner <apaseltiner@gmail.com>
Wed, 5 Aug 2015 19:12:10 +0000 (15:12 -0400)
committerAndrew Paseltiner <apaseltiner@gmail.com>
Wed, 5 Aug 2015 20:06:12 +0000 (16:06 -0400)
commit4fdeb353ceecd17fd7894bd7968d266a437d652e
tree66419e4434dcc186bae7b3b71c462164ceb98974
parentd03456183e85fe7bd465bbe7c8f67885a2528444
Fully generalize `BTree{Map, Set}` range iterators

This permits collections with `String` keys to be ranged over with
`&str` bounds. The `K` defaults for `Min` and `Max` permit the default
type parameter fallback to work with things like

```rust
use std::collections::{BTreeSet, Bound};
let set = BTreeSet::<String>::new();
set.range(Bound::Included("a"), Bound::Unbounded);
```

Without the defaults, the type of the maximum bound would be
unconstrained.
src/libcollections/btree/map.rs
src/libcollections/btree/node.rs
src/libcollections/btree/set.rs