File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: aac1298122ae9c7838b72f775f1f6d2a35444cc1
4
+ refs/heads/snap-stage3: e34756c9ba3bd07107e42a8bd6e0217f80b48ce9
5
5
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -569,8 +569,10 @@ loop {
569
569
This code prints out a weird sequence of numbers and stops as soon as
570
570
it finds one that can be divided by five.
571
571
572
- For more involved iteration, such as enumerating the elements of a
573
- collection, Rust uses [ higher-order functions] ( #closures ) .
572
+ Rust also has a ` for ` construct. It's different from C's ` for ` and it works
573
+ best when iterating over collections. See the section on [ closures] ( #closures )
574
+ to find out how to use ` for ` and higher-order functions for enumerating
575
+ elements of a collection.
574
576
575
577
# Data structures
576
578
@@ -1393,6 +1395,7 @@ assert!(crayons.len() == 3);
1393
1395
assert!(!crayons.is_empty());
1394
1396
1395
1397
// Iterate over a vector, obtaining a pointer to each element
1398
+ // (`for` is explained in the next section)
1396
1399
for crayons.each |crayon| {
1397
1400
let delicious_crayon_wax = unwrap_crayon(*crayon);
1398
1401
eat_crayon_wax(delicious_crayon_wax);
You can’t perform that action at this time.
0 commit comments