E0037#
Warning name: unused_loop_label
The loop label name is never used.
Erroneous example#
///|
fn main {
let mut sum = 0
let input = [1, 2, 3]
read~: loop input[:] {
[] => break
[head, .. tail] => {
sum += head
continue tail
}
}
println(sum)
}
Suggestion#
Remove the unused loop label.
///|
fn main {
let mut sum = 0
let input = [1, 2, 3]
for item in input {
sum += item
}
println(sum)
}