diff options
| author | djzin <noreply@github.com> | 2016-12-27 10:05:49 +0000 |
|---|---|---|
| committer | djzin <noreply@github.com> | 2017-01-14 16:51:51 +0000 |
| commit | 54a3487fc53017661a82aeec8b2d1794ae4fce0f (patch) | |
| tree | ac6d466bccca5febd9901f31f7e8f5525b7ec340 | |
| parent | bc6f80b382b1543766a7464660e3ed9c5a09efcf (diff) | |
| download | rust-54a3487fc53017661a82aeec8b2d1794ae4fce0f.tar.gz rust-54a3487fc53017661a82aeec8b2d1794ae4fce0f.zip | |
simplify some ranges
| -rw-r--r-- | src/libcollections/btree/map.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index 5b23fd13e51..f381a16d392 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -677,7 +677,7 @@ impl<K: Ord, V> BTreeMap<K, V> { /// for (&key, &value) in map.range((Included(&4), Included(&8))) { /// println!("{}: {}", key, value); /// } - /// assert_eq!(Some((&5, &"b")), map.range((Included(&4), Unbounded)).next()); + /// assert_eq!(Some((&5, &"b")), map.range(4..).next()); /// ``` #[unstable(feature = "btree_range", reason = "matches collection reform specification, waiting for dust to settle", @@ -763,7 +763,7 @@ impl<K: Ord, V> BTreeMap<K, V> { /// let mut map: BTreeMap<&str, i32> = ["Alice", "Bob", "Carol", "Cheryl"].iter() /// .map(|&s| (s, 0)) /// .collect(); - /// for (_, balance) in map.range_mut::<str, _>((Included("B"), Excluded("Cheryl"))) { + /// for (_, balance) in map.range_mut("B".."Cheryl") { /// *balance += 100; /// } /// for (name, balance) in &map { |
