Skip to content

Commit 60bab56

Browse files
committed
update docs with new syntax
1 parent b64df0b commit 60bab56

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

src/libcollections/btree/map.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -655,10 +655,12 @@ impl<K: Ord, V> BTreeMap<K, V> {
655655
self.fix_right_edge();
656656
}
657657

658-
/// Constructs a double-ended iterator over a sub-range of elements in the map, starting
659-
/// at min, and ending at max. If min is `Unbounded`, then it will be treated as "negative
660-
/// infinity", and if max is `Unbounded`, then it will be treated as "positive infinity".
661-
/// Thus range(Unbounded, Unbounded) will yield the whole collection.
658+
/// Constructs a double-ended iterator over a sub-range of elements in the map.
659+
/// The simplest way is to use the range synax `min..max`, thus `range(..)` will
660+
/// yield the whole collection.
661+
/// The range may also be entered as `(Bound<T>, Bound<T>)`, so for example
662+
/// `range((Excluded(4), Included(10)))` will yield a left-exclusive, right-inclusive
663+
/// range.
662664
///
663665
/// # Examples
664666
///
@@ -745,10 +747,12 @@ impl<K: Ord, V> BTreeMap<K, V> {
745747
}
746748
}
747749

748-
/// Constructs a mutable double-ended iterator over a sub-range of elements in the map, starting
749-
/// at min, and ending at max. If min is `Unbounded`, then it will be treated as "negative
750-
/// infinity", and if max is `Unbounded`, then it will be treated as "positive infinity".
751-
/// Thus range(Unbounded, Unbounded) will yield the whole collection.
750+
/// Constructs a mutable double-ended iterator over a sub-range of elements in the map.
751+
/// The simplest way is to use the range synax `min..max`, thus `range(..)` will
752+
/// yield the whole collection.
753+
/// The range may also be entered as `(Bound<T>, Bound<T>)`, so for example
754+
/// `range((Excluded(4), Included(10)))` will yield a left-exclusive, right-inclusive
755+
/// range.
752756
///
753757
/// # Examples
754758
///

src/libcollections/btree/set.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,12 @@ impl<T> BTreeSet<T> {
207207
}
208208

209209
impl<T: Ord> BTreeSet<T> {
210-
/// Constructs a double-ended iterator over a sub-range of elements in the set, starting
211-
/// at min, and ending at max. If min is `Unbounded`, then it will be treated as "negative
212-
/// infinity", and if max is `Unbounded`, then it will be treated as "positive infinity".
213-
/// Thus range(Unbounded, Unbounded) will yield the whole collection.
210+
/// Constructs a double-ended iterator over a sub-range of elements in the set.
211+
/// The simplest way is to use the range synax `min..max`, thus `range(..)` will
212+
/// yield the whole collection.
213+
/// The range may also be entered as `(Bound<T>, Bound<T>)`, so for example
214+
/// `range((Excluded(4), Included(10)))` will yield a left-exclusive, right-inclusive
215+
/// range.
214216
///
215217
/// # Examples
216218
///

0 commit comments

Comments
 (0)