Add test for partial range
This commit is contained in:
parent
c7e3e304d5
commit
1d0acce984
@ -25,4 +25,15 @@ fn range_to() {
|
||||
v.drain(..v.len()); // Nay
|
||||
}
|
||||
|
||||
fn partial_drains() {
|
||||
let mut v = vec![1, 2, 3];
|
||||
v.drain(1..); // Yay
|
||||
|
||||
let mut v = vec![1, 2, 3];
|
||||
v.drain(..v.len() - 1); // Yay
|
||||
|
||||
let mut v = vec![1, 2, 3];
|
||||
v.drain(1..v.len() - 1); // Yay
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user