about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-02-18 16:23:33 +0100
committerGitHub <noreply@github.com>2022-02-18 16:23:33 +0100
commita144ea1c4b39bdef608c537b25343674aa2b5bc7 (patch)
treef254265efe6fcda78534a586983a65940f4d6f1d /compiler/rustc_trait_selection/src
parentf1c918f1f3166c1cb2624ce2e2783d357e70dc3d (diff)
parentb80057d08d9f1b1726ec99dc57296cffec246bb1 (diff)
downloadrust-a144ea1c4b39bdef608c537b25343674aa2b5bc7.tar.gz
rust-a144ea1c4b39bdef608c537b25343674aa2b5bc7.zip
Rollup merge of #93634 - matthiaskrgr:clippy_complexity_jan_2022, r=oli-obk
compiler: clippy::complexity fixes

useless_format
map_flatten
useless_conversion
needless_bool
filter_next
clone_on_copy
needless_option_as_deref
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs3
-rw-r--r--compiler/rustc_trait_selection/src/traits/project.rs2
2 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
index f22b4e8d072..c3df17c83bb 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
@@ -1437,8 +1437,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
                                     self.tcx
                                         .associated_items(did)
                                         .in_definition_order()
-                                        .filter(|assoc| assoc.ident(self.tcx) == trait_assoc_ident)
-                                        .next()
+                                        .find(|assoc| assoc.ident(self.tcx) == trait_assoc_ident)
                                 },
                             )
                         })
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs
index 5f338664c9a..f5d531e631e 100644
--- a/compiler/rustc_trait_selection/src/traits/project.rs
+++ b/compiler/rustc_trait_selection/src/traits/project.rs
@@ -959,7 +959,7 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>(
                 infcx.inner.borrow_mut().projection_cache().insert_term(cache_key, result.clone());
             }
             obligations.extend(result.obligations);
-            Ok(Some(result.value.into()))
+            Ok(Some(result.value))
         }
         Ok(Projected::NoProgress(projected_ty)) => {
             let result = Normalized { value: projected_ty, obligations: vec![] };