about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohann Hemmann <johann.hemmann@code.berlin>2024-01-19 14:28:37 +0100
committerJohann Hemmann <johann.hemmann@code.berlin>2024-01-19 17:31:01 +0100
commiteb7aec5a8e064c5b0aec33ac17e070d3824c0467 (patch)
treed1b4b4107bb890818d1c1f6f7ef168dbdd86a0da
parent6709eaba2a2110b0df574460af7b2eb66e79ebf1 (diff)
downloadrust-eb7aec5a8e064c5b0aec33ac17e070d3824c0467.tar.gz
rust-eb7aec5a8e064c5b0aec33ac17e070d3824c0467.zip
map_clone
-rw-r--r--Cargo.toml1
-rw-r--r--crates/hir/src/source_analyzer.rs6
2 files changed, 2 insertions, 5 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 0e8600f65d9..c9ad876176e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -180,7 +180,6 @@ from_str_radix_10 = "allow"
 get_first = "allow"
 if_same_then_else = "allow"
 large_enum_variant = "allow"
-map_clone = "allow"
 match_like_matches_macro = "allow"
 match_single_binding = "allow"
 needless_borrow = "allow"
diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs
index 4dc30950da4..811e724747f 100644
--- a/crates/hir/src/source_analyzer.rs
+++ b/crates/hir/src/source_analyzer.rs
@@ -197,10 +197,8 @@ impl SourceAnalyzer {
     ) -> Option<(Type, Option<Type>)> {
         let pat_id = self.pat_id(pat)?;
         let infer = self.infer.as_ref()?;
-        let coerced = infer
-            .pat_adjustments
-            .get(&pat_id)
-            .and_then(|adjusts| adjusts.last().map(|adjust| adjust.clone()));
+        let coerced =
+            infer.pat_adjustments.get(&pat_id).and_then(|adjusts| adjusts.last().cloned());
         let ty = infer[pat_id].clone();
         let mk_ty = |ty| Type::new_with_resolver(db, &self.resolver, ty);
         Some((mk_ty(ty), coerced.map(mk_ty)))