]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/vec_resize_to_zero.rs
Rollup merge of #102345 - chenyukang:fix-102182-impl-trait, r=estebank
[rust.git] / src / tools / clippy / tests / ui / vec_resize_to_zero.rs
1 #![warn(clippy::vec_resize_to_zero)]
2
3 fn main() {
4     let mut v = vec![1, 2, 3, 4, 5];
5
6     // applicable here
7     v.resize(0, 5);
8
9     // not applicable
10     v.resize(2, 5);
11
12     let mut v = vec!["foo", "bar", "baz"];
13
14     // applicable here, but only implemented for integer literals for now
15     v.resize(0, "bar");
16
17     // not applicable
18     v.resize(2, "bar")
19 }