]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/vec_resize_to_zero.rs
Merge commit 'da5a6fb1b65ec6581a67e942a3850f6bc15a552c' into clippyup
[rust.git] / src / tools / clippy / tests / ui / vec_resize_to_zero.rs
1 #![warn(clippy::vec_resize_to_zero)]
2
3 fn main() {
4     // applicable here
5     vec![1, 2, 3, 4, 5].resize(0, 5);
6
7     // not applicable
8     vec![1, 2, 3, 4, 5].resize(2, 5);
9
10     // applicable here, but only implemented for integer literals for now
11     vec!["foo", "bar", "baz"].resize(0, "bar");
12
13     // not applicable
14     vec!["foo", "bar", "baz"].resize(2, "bar")
15 }