2020-05-22 17:07:09 -05:00
|
|
|
#![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);
|
|
|
|
|
2020-07-16 18:58:41 -05:00
|
|
|
// applicable here, but only implemented for integer literals for now
|
2020-05-22 17:07:09 -05:00
|
|
|
vec!["foo", "bar", "baz"].resize(0, "bar");
|
|
|
|
|
|
|
|
// not applicable
|
|
|
|
vec!["foo", "bar", "baz"].resize(2, "bar")
|
|
|
|
}
|