2013-01-29 21:30:22 -05:00
|
|
|
fn bar(v: &mut [uint]) -> ~[uint] {
|
2013-06-22 14:43:15 -04:00
|
|
|
v.to_owned()
|
2013-01-22 17:20:08 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
fn bip(v: &[uint]) -> ~[uint] {
|
2013-06-22 14:43:15 -04:00
|
|
|
v.to_owned()
|
2013-01-22 17:20:08 -08:00
|
|
|
}
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2013-06-22 14:43:15 -04: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 17:20:08 -08:00
|
|
|
}
|