about summary refs log tree commit diff
path: root/clippy_lints
diff options
context:
space:
mode:
authorkyoto7250 <50972773+kyoto7250@users.noreply.github.com>2022-06-10 21:02:43 +0900
committerkyoto7250 <50972773+kyoto7250@users.noreply.github.com>2022-06-27 08:11:58 +0900
commitdd3d0fdad30249505688eada4481b1d78190e971 (patch)
treee42dc8f32f1915e346d3ec7680e95afa64297e77 /clippy_lints
parent4decfdec76a6b67dc87f29d6f1a8db148119211d (diff)
downloadrust-dd3d0fdad30249505688eada4481b1d78190e971.tar.gz
rust-dd3d0fdad30249505688eada4481b1d78190e971.zip
rename use_retain => manual_retain
Diffstat (limited to 'clippy_lints')
-rw-r--r--clippy_lints/src/lib.register_all.rs2
-rw-r--r--clippy_lints/src/lib.register_lints.rs2
-rw-r--r--clippy_lints/src/lib.register_perf.rs2
-rw-r--r--clippy_lints/src/lib.rs4
-rw-r--r--clippy_lints/src/manual_retain.rs (renamed from clippy_lints/src/use_retain.rs)12
5 files changed, 11 insertions, 11 deletions
diff --git a/clippy_lints/src/lib.register_all.rs b/clippy_lints/src/lib.register_all.rs
index 88e4c291b68..696f0c6f6b3 100644
--- a/clippy_lints/src/lib.register_all.rs
+++ b/clippy_lints/src/lib.register_all.rs
@@ -136,6 +136,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(manual_bits::MANUAL_BITS),
     LintId::of(manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE),
     LintId::of(manual_rem_euclid::MANUAL_REM_EUCLID),
+    LintId::of(manual_retain::MANUAL_RETAIN),
     LintId::of(manual_strip::MANUAL_STRIP),
     LintId::of(map_clone::MAP_CLONE),
     LintId::of(map_unit_fn::OPTION_MAP_UNIT_FN),
@@ -336,7 +337,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(unwrap::PANICKING_UNWRAP),
     LintId::of(unwrap::UNNECESSARY_UNWRAP),
     LintId::of(upper_case_acronyms::UPPER_CASE_ACRONYMS),
-    LintId::of(use_retain::USE_RETAIN),
     LintId::of(useless_conversion::USELESS_CONVERSION),
     LintId::of(vec::USELESS_VEC),
     LintId::of(vec_init_then_push::VEC_INIT_THEN_PUSH),
diff --git a/clippy_lints/src/lib.register_lints.rs b/clippy_lints/src/lib.register_lints.rs
index 187786e80da..f24c65fb35b 100644
--- a/clippy_lints/src/lib.register_lints.rs
+++ b/clippy_lints/src/lib.register_lints.rs
@@ -255,6 +255,7 @@ store.register_lints(&[
     manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE,
     manual_ok_or::MANUAL_OK_OR,
     manual_rem_euclid::MANUAL_REM_EUCLID,
+    manual_retain::MANUAL_RETAIN,
     manual_strip::MANUAL_STRIP,
     map_clone::MAP_CLONE,
     map_err_ignore::MAP_ERR_IGNORE,
@@ -563,7 +564,6 @@ store.register_lints(&[
     unwrap::UNNECESSARY_UNWRAP,
     unwrap_in_result::UNWRAP_IN_RESULT,
     upper_case_acronyms::UPPER_CASE_ACRONYMS,
-    use_retain::USE_RETAIN,
     use_self::USE_SELF,
     useless_conversion::USELESS_CONVERSION,
     vec::USELESS_VEC,
diff --git a/clippy_lints/src/lib.register_perf.rs b/clippy_lints/src/lib.register_perf.rs
index b9d8ec72541..2233b118849 100644
--- a/clippy_lints/src/lib.register_perf.rs
+++ b/clippy_lints/src/lib.register_perf.rs
@@ -13,6 +13,7 @@ store.register_group(true, "clippy::perf", Some("clippy_perf"), vec![
     LintId::of(loops::MANUAL_MEMCPY),
     LintId::of(loops::MISSING_SPIN_LOOP),
     LintId::of(loops::NEEDLESS_COLLECT),
+    LintId::of(manual_retain::MANUAL_RETAIN),
     LintId::of(methods::EXPECT_FUN_CALL),
     LintId::of(methods::EXTEND_WITH_DRAIN),
     LintId::of(methods::ITER_NTH),
@@ -26,7 +27,6 @@ store.register_group(true, "clippy::perf", Some("clippy_perf"), vec![
     LintId::of(slow_vector_initialization::SLOW_VECTOR_INITIALIZATION),
     LintId::of(types::BOX_COLLECTION),
     LintId::of(types::REDUNDANT_ALLOCATION),
-    LintId::of(use_retain::USE_RETAIN),
     LintId::of(vec::USELESS_VEC),
     LintId::of(vec_init_then_push::VEC_INIT_THEN_PUSH),
 ])
diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs
index 716038aa522..a068d5ab522 100644
--- a/clippy_lints/src/lib.rs
+++ b/clippy_lints/src/lib.rs
@@ -283,6 +283,7 @@ mod manual_bits;
 mod manual_non_exhaustive;
 mod manual_ok_or;
 mod manual_rem_euclid;
+mod manual_retain;
 mod manual_strip;
 mod map_clone;
 mod map_err_ignore;
@@ -410,7 +411,6 @@ mod unused_unit;
 mod unwrap;
 mod unwrap_in_result;
 mod upper_case_acronyms;
-mod use_retain;
 mod use_self;
 mod useless_conversion;
 mod vec;
@@ -915,7 +915,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
     store.register_late_pass(|| Box::new(read_zero_byte_vec::ReadZeroByteVec));
     store.register_late_pass(|| Box::new(default_instead_of_iter_empty::DefaultIterEmpty));
     store.register_late_pass(move || Box::new(manual_rem_euclid::ManualRemEuclid::new(msrv)));
-    store.register_late_pass(move || Box::new(use_retain::UseRetain::new(msrv)));
+    store.register_late_pass(move || Box::new(manual_retain::ManualRetain::new(msrv)));
     // add lints here, do not remove this comment, it's used in `new_lint`
 }
 
diff --git a/clippy_lints/src/use_retain.rs b/clippy_lints/src/manual_retain.rs
index 185201514ad..450c6d343c0 100644
--- a/clippy_lints/src/use_retain.rs
+++ b/clippy_lints/src/manual_retain.rs
@@ -44,25 +44,25 @@ declare_clippy_lint! {
     /// vec.retain(|x| x % 2 == 0);
     /// ```
     #[clippy::version = "1.63.0"]
-    pub USE_RETAIN,
+    pub MANUAL_RETAIN,
     perf,
     "`retain()` is simpler and the same functionalitys"
 }
 
-pub struct UseRetain {
+pub struct ManualRetain {
     msrv: Option<RustcVersion>,
 }
 
-impl UseRetain {
+impl ManualRetain {
     #[must_use]
     pub fn new(msrv: Option<RustcVersion>) -> Self {
         Self { msrv }
     }
 }
 
-impl_lint_pass!(UseRetain => [USE_RETAIN]);
+impl_lint_pass!(ManualRetain => [MANUAL_RETAIN]);
 
-impl<'tcx> LateLintPass<'tcx> for UseRetain {
+impl<'tcx> LateLintPass<'tcx> for ManualRetain {
     fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) {
         if let Some(parent_expr) = get_parent_expr(cx, expr)
             && let Assign(left_expr, collect_expr, _) = &parent_expr.kind
@@ -170,7 +170,7 @@ fn suggest(cx: &LateContext<'_>, parent_expr: &hir::Expr<'_>, left_expr: &hir::E
         } {
         span_lint_and_sugg(
             cx,
-            USE_RETAIN,
+            MANUAL_RETAIN,
             parent_expr.span,
             "this expression can be written more simply using `.retain()`",
             "consider calling `.retain()` instead",