mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +00:00
40 lines
1.1 KiB
Text
40 lines
1.1 KiB
Text
error: `drain` used to clear a `Vec`
|
|
--> $DIR/clear_with_drain.rs:17:7
|
|
|
|
|
LL | v.drain(0..v.len()); // Nay
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `clear()`
|
|
|
|
|
= note: `-D clippy::clear-with-drain` implied by `-D warnings`
|
|
|
|
error: `drain` used to clear a `Vec`
|
|
--> $DIR/clear_with_drain.rs:20:7
|
|
|
|
|
LL | v.drain(usize::MIN..v.len()); // Nay
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `clear()`
|
|
|
|
error: `drain` used to clear a `Vec`
|
|
--> $DIR/clear_with_drain.rs:35:7
|
|
|
|
|
LL | v.drain(0..); // Nay
|
|
| ^^^^^^^^^^ help: try: `clear()`
|
|
|
|
error: `drain` used to clear a `Vec`
|
|
--> $DIR/clear_with_drain.rs:38:7
|
|
|
|
|
LL | v.drain(usize::MIN..); // Nay
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `clear()`
|
|
|
|
error: `drain` used to clear a `Vec`
|
|
--> $DIR/clear_with_drain.rs:52:7
|
|
|
|
|
LL | v.drain(..); // Nay
|
|
| ^^^^^^^^^ help: try: `clear()`
|
|
|
|
error: `drain` used to clear a `Vec`
|
|
--> $DIR/clear_with_drain.rs:66:7
|
|
|
|
|
LL | v.drain(..v.len()); // Nay
|
|
| ^^^^^^^^^^^^^^^^ help: try: `clear()`
|
|
|
|
error: aborting due to 6 previous errors
|
|
|