about summary refs log tree commit diff
path: root/clippy_lints/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-24 10:11:23 -0400
committerMichael Goulet <michael@errs.io>2024-09-24 10:12:05 -0400
commitf8969853ebcf591b20d38ca3ff3b72537be8f581 (patch)
tree449c9318e1e30b63c9d1d709eb09055d1f904d13 /clippy_lints/src
parent249210e8d86a4de347def1be559dfa79d346cb9f (diff)
Fix tools
Diffstat (limited to 'clippy_lints/src')
-rw-r--r--clippy_lints/src/derive.rs1
-rw-r--r--clippy_lints/src/inherent_impl.rs4
-rw-r--r--clippy_lints/src/len_zero.rs3
-rw-r--r--clippy_lints/src/methods/or_fun_call.rs1
4 files changed, 2 insertions, 7 deletions
diff --git a/clippy_lints/src/derive.rs b/clippy_lints/src/derive.rs
index 636698e96f6..649c480fb92 100644
--- a/clippy_lints/src/derive.rs
+++ b/clippy_lints/src/derive.rs
@@ -386,7 +386,6 @@ fn check_unsafe_derive_deserialize<'tcx>(
             .tcx
             .inherent_impls(def.did())
             .into_iter()
-            .flatten()
             .map(|imp_did| cx.tcx.hir().expect_item(imp_did.expect_local()))
             .any(|imp| has_unsafe(cx, imp))
     {
diff --git a/clippy_lints/src/inherent_impl.rs b/clippy_lints/src/inherent_impl.rs
index d39f910f993..309d2dfb28b 100644
--- a/clippy_lints/src/inherent_impl.rs
+++ b/clippy_lints/src/inherent_impl.rs
@@ -51,9 +51,7 @@ impl<'tcx> LateLintPass<'tcx> for MultipleInherentImpl {
         // List of spans to lint. (lint_span, first_span)
         let mut lint_spans = Vec::new();
 
-        let Ok(impls) = cx.tcx.crate_inherent_impls(()) else {
-            return;
-        };
+        let (impls, _) = cx.tcx.crate_inherent_impls(());
 
         for (&id, impl_ids) in &impls.inherent_impls {
             if impl_ids.len() < 2
diff --git a/clippy_lints/src/len_zero.rs b/clippy_lints/src/len_zero.rs
index 0bc7fc2dd9d..16f86b18e2e 100644
--- a/clippy_lints/src/len_zero.rs
+++ b/clippy_lints/src/len_zero.rs
@@ -448,7 +448,6 @@ fn check_for_is_empty(
         .tcx
         .inherent_impls(impl_ty)
         .into_iter()
-        .flatten()
         .flat_map(|&id| cx.tcx.associated_items(id).filter_by_name_unhygienic(is_empty))
         .find(|item| item.kind == AssocKind::Fn);
 
@@ -616,7 +615,7 @@ fn has_is_empty(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
     /// Checks the inherent impl's items for an `is_empty(self)` method.
     fn has_is_empty_impl(cx: &LateContext<'_>, id: DefId) -> bool {
         let is_empty = sym!(is_empty);
-        cx.tcx.inherent_impls(id).into_iter().flatten().any(|imp| {
+        cx.tcx.inherent_impls(id).into_iter().any(|imp| {
             cx.tcx
                 .associated_items(*imp)
                 .filter_by_name_unhygienic(is_empty)
diff --git a/clippy_lints/src/methods/or_fun_call.rs b/clippy_lints/src/methods/or_fun_call.rs
index e4326cb958e..af71799f0a7 100644
--- a/clippy_lints/src/methods/or_fun_call.rs
+++ b/clippy_lints/src/methods/or_fun_call.rs
@@ -78,7 +78,6 @@ pub(super) fn check<'tcx>(
             cx.tcx
                 .inherent_impls(adt_def.did())
                 .into_iter()
-                .flatten()
                 .flat_map(|impl_id| cx.tcx.associated_items(impl_id).filter_by_name_unhygienic(sugg))
                 .find_map(|assoc| {
                     if assoc.fn_has_self_parameter