File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: 0983ebe5310d4eb6d289f636f7ed0536c08bbc0e
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
- refs/heads/dist-snap: db55cd92dec88c3ff025ecf8b4900aca4520bea6
9
+ refs/heads/dist-snap: ea32d019c4f8da8a1754e9c69a1ba98832c8889c
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
12
12
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
Original file line number Diff line number Diff line change @@ -160,6 +160,18 @@ assert_eq!(sum, 57);
160
160
161
161
## For loops
162
162
163
+ The function `range` (or `range_inclusive`) allows to simply iterate through a given range:
164
+
165
+ ~~~
166
+ for i in range(0, 5) {
167
+ printf!("%d ", i) // prints "0 1 2 3 4"
168
+ }
169
+
170
+ for i in std::iterator::range_inclusive(0, 5) { // needs explicit import
171
+ printf!("%d ", i) // prints "0 1 2 3 4 5"
172
+ }
173
+ ~~~
174
+
163
175
The `for` keyword can be used as sugar for iterating through any iterator:
164
176
165
177
~~~
You can’t perform that action at this time.
0 commit comments