Skip to content

Commit 2cc5211

Browse files
committed
Auto merge of #9034 - alex-semenyuk:example_vec_resize_to_zero, r=giraffate
Example for VEC_RESIZE_TO_ZERO changelog: none Example for VEC_RESIZE_TO_ZERO - what we should use instead
2 parents 6985e65 + b969326 commit 2cc5211

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clippy_lints/src/vec_resize_to_zero.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ declare_clippy_lint! {
2020
/// ```rust
2121
/// vec!(1, 2, 3, 4, 5).resize(0, 5)
2222
/// ```
23+
///
24+
/// Use instead:
25+
/// ```rust
26+
/// vec!(1, 2, 3, 4, 5).clear()
27+
/// ```
2328
#[clippy::version = "1.46.0"]
2429
pub VEC_RESIZE_TO_ZERO,
2530
correctness,

0 commit comments

Comments
 (0)