Add test for partial range

This commit is contained in:
bluthej 2023-03-21 22:09:26 +01:00
parent c7e3e304d5
commit 1d0acce984

View file

@ -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() {}