let mut i = 0;
while i < 3 {
i += 1;
}
let mut i = 0;
loop {
if i >= 3 { break; }
i += 1;
}
for i in range(0, 3) {
...
}
let opt = Some(3);
match opt {
Some(ref v) => { ... }
None => { ... }
}
let mut v = ~[];
v.push(1); // Append an element.
v.push(2);
v.push(3);
v.swap(0, 2); // Exchange two elements.
v.pop(); // Remove and return last element.
fn get_key<'a>(entry: &'a Entry<int, int>) -> &'a int {
&entry.key
}