mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-24 20:13:24 +00:00
15 lines
368 B
Rust
15 lines
368 B
Rust
#![warn(clippy::vec_resize_to_zero)]
|
|
|
|
fn main() {
|
|
// applicable here
|
|
vec![1, 2, 3, 4, 5].resize(0, 5);
|
|
|
|
// not applicable
|
|
vec![1, 2, 3, 4, 5].resize(2, 5);
|
|
|
|
// applicable here, but only implemented for integer litterals for now
|
|
vec!["foo", "bar", "baz"].resize(0, "bar");
|
|
|
|
// not applicable
|
|
vec!["foo", "bar", "baz"].resize(2, "bar")
|
|
}
|