From b969326874ecd1f0a9e52aab629d089f258039b4 Mon Sep 17 00:00:00 2001 From: alexey semenyuk Date: Wed, 22 Jun 2022 11:01:52 +0000 Subject: [PATCH] Example for VEC_RESIZE_TO_ZERO --- clippy_lints/src/vec_resize_to_zero.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clippy_lints/src/vec_resize_to_zero.rs b/clippy_lints/src/vec_resize_to_zero.rs index 4d86abd0fa1..0fee3e812d2 100644 --- a/clippy_lints/src/vec_resize_to_zero.rs +++ b/clippy_lints/src/vec_resize_to_zero.rs @@ -20,6 +20,11 @@ declare_clippy_lint! { /// ```rust /// vec!(1, 2, 3, 4, 5).resize(0, 5) /// ``` + /// + /// Use instead: + /// ```rust + /// vec!(1, 2, 3, 4, 5).clear() + /// ``` #[clippy::version = "1.46.0"] pub VEC_RESIZE_TO_ZERO, correctness,