We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 838c62b commit fbadb36Copy full SHA for fbadb36
src/doc/tutorial.md
@@ -582,6 +582,18 @@ loop {
582
This code prints out a weird sequence of numbers and stops as soon as
583
it finds one that can be divided by five.
584
585
+There is also a for-loop that can be used to iterate over a range of numbers
586
+(or, more generally, anything implementing the `Iterator` trait):
587
+
588
+~~~~
589
+for n in range(0, 5) {
590
+ println!("{}", n);
591
+}
592
593
594
+The snippet above prints integer numbers under 5 starting at 0.
595
596
597
# Data structures
598
599
## Structs
0 commit comments