Skip to content

Loop Labels

IsaacShelton edited this page Mar 21, 2022 · 1 revision

Loop Labels

Loop labels allow for performing certain actions with regards to a specific loop

for outer_loop : (i usize = 0; i < 10; i++){
    for inner_loop : (j usize = 0; j < 10; j++){
        if i + j == 16, break outer_loop
    }
}

See conditional statements and break and continue for more information

Clone this wiki locally