aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir_def/src/path/lower.rs6
-rw-r--r--crates/ra_hir_ty/src/infer/pat.rs8
2 files changed, 3 insertions, 11 deletions
diff --git a/crates/ra_hir_def/src/path/lower.rs b/crates/ra_hir_def/src/path/lower.rs
index 0934520d7..4900000fe 100644
--- a/crates/ra_hir_def/src/path/lower.rs
+++ b/crates/ra_hir_def/src/path/lower.rs
@@ -101,11 +101,7 @@ pub(super) fn lower_path(mut path: ast::Path, hygiene: &Hygiene) -> Option<Path>
101 break; 101 break;
102 } 102 }
103 ast::PathSegmentKind::SuperKw => { 103 ast::PathSegmentKind::SuperKw => {
104 let nested_super_count = if let PathKind::Super(n) = kind { 104 let nested_super_count = if let PathKind::Super(n) = kind { n } else { 0 };
105 n
106 } else {
107 0
108 };
109 kind = PathKind::Super(nested_super_count + 1); 105 kind = PathKind::Super(nested_super_count + 1);
110 } 106 }
111 } 107 }
diff --git a/crates/ra_hir_ty/src/infer/pat.rs b/crates/ra_hir_ty/src/infer/pat.rs
index 623e52599..7a84e47f8 100644
--- a/crates/ra_hir_ty/src/infer/pat.rs
+++ b/crates/ra_hir_ty/src/infer/pat.rs
@@ -187,12 +187,8 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
187 } 187 }
188 Pat::Slice { prefix, slice: _slice, suffix } => { 188 Pat::Slice { prefix, slice: _slice, suffix } => {
189 let (container_ty, elem_ty) = match &expected { 189 let (container_ty, elem_ty) = match &expected {
190 ty_app!(TypeCtor::Array, st) => { 190 ty_app!(TypeCtor::Array, st) => (TypeCtor::Array, st.as_single().clone()),
191 (TypeCtor::Array, st.as_single().clone()) 191 ty_app!(TypeCtor::Slice, st) => (TypeCtor::Slice, st.as_single().clone()),
192 },
193 ty_app!(TypeCtor::Slice, st) => {
194 (TypeCtor::Slice, st.as_single().clone())
195 },
196 _ => (TypeCtor::Slice, Ty::Unknown), 192 _ => (TypeCtor::Slice, Ty::Unknown),
197 }; 193 };
198 194