aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/diagnostics
diff options
context:
space:
mode:
authorMaan2003 <[email protected]>2021-06-13 04:54:16 +0100
committerMaan2003 <[email protected]>2021-06-13 04:54:16 +0100
commitc9b4ac5be4daaabc062ab1ee663eba8594750003 (patch)
tree6090c8c38c735875c916255920525cf5fff45c75 /crates/hir_ty/src/diagnostics
parentd6737e55fb49d286b5e646f57975b27b2c95ce92 (diff)
clippy::redudant_borrow
Diffstat (limited to 'crates/hir_ty/src/diagnostics')
-rw-r--r--crates/hir_ty/src/diagnostics/match_check/deconstruct_pat.rs2
-rw-r--r--crates/hir_ty/src/diagnostics/match_check/usefulness.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir_ty/src/diagnostics/match_check/deconstruct_pat.rs b/crates/hir_ty/src/diagnostics/match_check/deconstruct_pat.rs
index 222141bd6..088d2791e 100644
--- a/crates/hir_ty/src/diagnostics/match_check/deconstruct_pat.rs
+++ b/crates/hir_ty/src/diagnostics/match_check/deconstruct_pat.rs
@@ -528,7 +528,7 @@ impl SplitWildcard {
528 smallvec![NonExhaustive] 528 smallvec![NonExhaustive]
529 } 529 }
530 TyKind::Never => SmallVec::new(), 530 TyKind::Never => SmallVec::new(),
531 _ if cx.is_uninhabited(&pcx.ty) => SmallVec::new(), 531 _ if cx.is_uninhabited(pcx.ty) => SmallVec::new(),
532 TyKind::Adt(..) | TyKind::Tuple(..) | TyKind::Ref(..) => smallvec![Single], 532 TyKind::Adt(..) | TyKind::Tuple(..) | TyKind::Ref(..) => smallvec![Single],
533 // This type is one for which we cannot list constructors, like `str` or `f64`. 533 // This type is one for which we cannot list constructors, like `str` or `f64`.
534 _ => smallvec![NonExhaustive], 534 _ => smallvec![NonExhaustive],
diff --git a/crates/hir_ty/src/diagnostics/match_check/usefulness.rs b/crates/hir_ty/src/diagnostics/match_check/usefulness.rs
index bd76a606c..f5ac71444 100644
--- a/crates/hir_ty/src/diagnostics/match_check/usefulness.rs
+++ b/crates/hir_ty/src/diagnostics/match_check/usefulness.rs
@@ -645,7 +645,7 @@ impl SubPatSet {
645 (Seq { subpats: s_set }, Seq { subpats: mut o_set }) => { 645 (Seq { subpats: s_set }, Seq { subpats: mut o_set }) => {
646 s_set.retain(|i, s_sub_set| { 646 s_set.retain(|i, s_sub_set| {
647 // Missing entries count as full. 647 // Missing entries count as full.
648 let o_sub_set = o_set.remove(&i).unwrap_or(Full); 648 let o_sub_set = o_set.remove(i).unwrap_or(Full);
649 s_sub_set.union(o_sub_set); 649 s_sub_set.union(o_sub_set);
650 // We drop full entries. 650 // We drop full entries.
651 !s_sub_set.is_full() 651 !s_sub_set.is_full()
@@ -656,7 +656,7 @@ impl SubPatSet {
656 (Alt { subpats: s_set, .. }, Alt { subpats: mut o_set, .. }) => { 656 (Alt { subpats: s_set, .. }, Alt { subpats: mut o_set, .. }) => {
657 s_set.retain(|i, s_sub_set| { 657 s_set.retain(|i, s_sub_set| {
658 // Missing entries count as empty. 658 // Missing entries count as empty.
659 let o_sub_set = o_set.remove(&i).unwrap_or(Empty); 659 let o_sub_set = o_set.remove(i).unwrap_or(Empty);
660 s_sub_set.union(o_sub_set); 660 s_sub_set.union(o_sub_set);
661 // We drop empty entries. 661 // We drop empty entries.
662 !s_sub_set.is_empty() 662 !s_sub_set.is_empty()
@@ -898,7 +898,7 @@ impl Usefulness {
898 } else { 898 } else {
899 witnesses 899 witnesses
900 .into_iter() 900 .into_iter()
901 .map(|witness| witness.apply_constructor(pcx, &ctor, ctor_wild_subpatterns)) 901 .map(|witness| witness.apply_constructor(pcx, ctor, ctor_wild_subpatterns))
902 .collect() 902 .collect()
903 }; 903 };
904 WithWitnesses(new_witnesses) 904 WithWitnesses(new_witnesses)