Skip to content

Commit 54a3487

Browse files
committed
simplify some ranges
1 parent bc6f80b commit 54a3487

File tree

1 file changed

+2
-2
lines changed
  • src/libcollections/btree

1 file changed

+2
-2
lines changed

src/libcollections/btree/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
677677
/// for (&key, &value) in map.range((Included(&4), Included(&8))) {
678678
/// println!("{}: {}", key, value);
679679
/// }
680-
/// assert_eq!(Some((&5, &"b")), map.range((Included(&4), Unbounded)).next());
680+
/// assert_eq!(Some((&5, &"b")), map.range(4..).next());
681681
/// ```
682682
#[unstable(feature = "btree_range",
683683
reason = "matches collection reform specification, waiting for dust to settle",
@@ -763,7 +763,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
763763
/// let mut map: BTreeMap<&str, i32> = ["Alice", "Bob", "Carol", "Cheryl"].iter()
764764
/// .map(|&s| (s, 0))
765765
/// .collect();
766-
/// for (_, balance) in map.range_mut::<str, _>((Included("B"), Excluded("Cheryl"))) {
766+
/// for (_, balance) in map.range_mut("B".."Cheryl") {
767767
/// *balance += 100;
768768
/// }
769769
/// for (name, balance) in &map {

0 commit comments

Comments
 (0)