rustup; add swap_remove test
This commit is contained in:
parent
24a1d78a70
commit
a6b12c229b
@ -1 +1 @@
|
||||
81117ff930fbf3792b4f9504e3c6bccc87b10823
|
||||
e015ef5b2633960e7653b744d7a1c3d1d336313a
|
||||
|
@ -140,6 +140,14 @@ fn swap() {
|
||||
v.swap(2, 2);
|
||||
}
|
||||
|
||||
fn swap_remove() {
|
||||
let mut a = 0;
|
||||
let mut b = 1;
|
||||
let mut vec = vec![&mut a, &mut b];
|
||||
|
||||
vec.swap_remove(1);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
assert_eq!(vec_reallocate().len(), 5);
|
||||
|
||||
@ -167,4 +175,5 @@ fn main() {
|
||||
|
||||
sort();
|
||||
swap();
|
||||
swap_remove();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user