2013-05-24 21:35:29 -05:00
|
|
|
use std::vec;
|
|
|
|
|
2013-01-22 19:20:08 -06:00
|
|
|
trait Reverser {
|
|
|
|
fn reverse(&self);
|
|
|
|
}
|
|
|
|
|
2013-01-29 20:30:22 -06:00
|
|
|
fn bar(v: &mut [uint]) {
|
2013-01-22 19:20:08 -06:00
|
|
|
vec::reverse(v);
|
|
|
|
vec::reverse(v);
|
|
|
|
vec::reverse(v);
|
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2013-01-22 19:20:08 -06:00
|
|
|
let mut the_vec = ~[1, 2, 3, 100];
|
|
|
|
bar(the_vec);
|
2013-05-18 21:02:45 -05:00
|
|
|
assert_eq!(the_vec, ~[100, 3, 2, 1]);
|
2013-01-22 19:20:08 -06:00
|
|
|
}
|