Skip to content

Commit b969326

Browse files
Example for VEC_RESIZE_TO_ZERO
1 parent f9fea17 commit b969326

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)