mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
Add test for partial range
This commit is contained in:
parent
c7e3e304d5
commit
1d0acce984
1 changed files with 11 additions and 0 deletions
|
@ -25,4 +25,15 @@ fn range_to() {
|
||||||
v.drain(..v.len()); // Nay
|
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() {}
|
fn main() {}
|
||||||
|
|
Loading…
Reference in a new issue