2013-01-29 20:30:22 -06:00
|
|
|
fn bar(v: &mut [uint]) -> ~[uint] {
|
2013-06-22 13:43:15 -05:00
|
|
|
v.to_owned()
|
2013-01-22 19:20:08 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn bip(v: &[uint]) -> ~[uint] {
|
2013-06-22 13:43:15 -05:00
|
|
|
v.to_owned()
|
2013-01-22 19:20:08 -06:00
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2013-06-22 13:43:15 -05:00
|
|
|
let mut the_vec = ~[1u, 2, 3, 100];
|
|
|
|
assert_eq!(the_vec.clone(), bar(the_vec));
|
|
|
|
assert_eq!(the_vec.clone(), bip(the_vec));
|
2013-01-22 19:20:08 -06:00
|
|
|
}
|