Range syntax

This commit is contained in:
Stephan Rehfeld 2026-04-08 18:05:06 +02:00
parent 97e5c2fd72
commit c77982c642

View File

@ -1,9 +1,5 @@
fn main() {
// Definition of an array
let arr = [4, 8, 15, 16, 23, 42];
// loop over every element of the array
for value in arr {
for value in -10..10 {
println!("Value: {}", value);
}
}