We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Code looks like this:
fn consume<T>(+v: ~[T], f: fn(uint, +v: T)) unsafe { do as_imm_buf(v) |p, ln| { for uint::range(0, ln) |i| { let x <- *ptr::offset(p, i); f(i, move x); } } raw::set_len(v, 0); }
What happens if the callback fails in the middle of the loop?