about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-06-22 23:59:16 +0000
committerbors <bors@rust-lang.org>2022-06-22 23:59:16 +0000
commit2cc5211584c7d813860706bafa49ee70c38a1f7b (patch)
treec635b7157dd1fdc1b0d3f8d9e4d5f191ea724e1a
parent6985e6592b36d49d2a0ae4184d44f82d4b763fb5 (diff)
parentb969326874ecd1f0a9e52aab629d089f258039b4 (diff)
downloadrust-2cc5211584c7d813860706bafa49ee70c38a1f7b.tar.gz
rust-2cc5211584c7d813860706bafa49ee70c38a1f7b.zip
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
-rw-r--r--clippy_lints/src/vec_resize_to_zero.rs5
1 files changed, 5 insertions, 0 deletions
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,