> (Have to double space due to lack of formatting capabilities here.)
Indent by four spaces to get a <pre> tag:
let mut v = vec![1i32, 2, 3, 4, 5];
let vlen = v.len()
for i in range(0, vlen) {
let x = &mut v[i];
// do some work with x
}
> This seems to be a forgotten technology.Given what I know about Rust, I strongly suspect that there is a way in Rust to iterate over a vector with only a single hoisted bounds-check. Hopefully other Rust people can chime in on what this is.