Skip to content

Commit 8fb5846

Browse files
committed
---
yaml --- r: 124798 b: refs/heads/master c: ba769d8 h: refs/heads/master v: v3
1 parent 46cdc0d commit 8fb5846

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 428d814a7d100f07feb87e4ffb7f4a0999bd556a
2+
refs/heads/master: ba769d833f3e3f71c9b0d7d39cd6aec268e2ad56
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9fc8394d3bce22ab483f98842434c84c396212ae
55
refs/heads/try: e398fc9998259d5ff86bbf5028c258aaec548c47

trunk/src/libcore/iter.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,19 @@ pub struct Range<A> {
19621962
one: A
19631963
}
19641964

1965-
/// Return an iterator over the range [start, stop)
1965+
/// Returns an iterator over the given range [start, stop) (that is, starting
1966+
/// at start (inclusive), and ending at stop (exclusive)).
1967+
///
1968+
/// # Example
1969+
///
1970+
/// ```rust
1971+
/// let array = [0, 1, 2, 3, 4];
1972+
///
1973+
/// for i in range(0, 5u) {
1974+
/// println!("{}", i);
1975+
/// assert_eq!(i, array[i]);
1976+
/// }
1977+
/// ```
19661978
#[inline]
19671979
pub fn range<A: Add<A, A> + PartialOrd + Clone + One>(start: A, stop: A) -> Range<A> {
19681980
Range{state: start, stop: stop, one: One::one()}

0 commit comments

Comments
 (0)