Use 1..10 for an exclusive range that stops before the end value, and 1..=10 for an inclusive range that includes the end value.
let exclusive = 1..10; // 1, 2, ..., 9
let inclusive = 1..=10; // 1, 2, ..., 10
for i in 1..10 {
println!("exclusive: {i}");
}
for i in 1..=10 {
println!("inclusive: {i}");
}