On 6/16/12 8:15 AM, Patrick Walton wrote:
I assume you mean labeled break, right? Otherwise this won't do what you expect:

    for array.each |x| {
        if (x == 1) {
            break;
        }
    }

Yes, of course. Thinking about it a bit more: I guess `break` breaks out of the nearest `while`, `do` or `for` statement. That's perfectly consistent without needing to dive into labeled break from blocks. I'm not sure why I thought otherwise.


Niko


_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to