diff options
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r-- | crates/ra_hir/src/ty.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index cc5afad75..86a7f8b83 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs | |||
@@ -1225,7 +1225,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
1225 | Ty::Tuple(ref tuple_args) => &**tuple_args, | 1225 | Ty::Tuple(ref tuple_args) => &**tuple_args, |
1226 | _ => &[], | 1226 | _ => &[], |
1227 | }; | 1227 | }; |
1228 | let expectations_iter = expectations.into_iter().chain(repeat(&Ty::Unknown)); | 1228 | let expectations_iter = expectations.iter().chain(repeat(&Ty::Unknown)); |
1229 | 1229 | ||
1230 | let inner_tys = args | 1230 | let inner_tys = args |
1231 | .iter() | 1231 | .iter() |
@@ -1398,10 +1398,10 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
1398 | let method_ty = self.insert_type_vars(method_ty); | 1398 | let method_ty = self.insert_type_vars(method_ty); |
1399 | let (expected_receiver_ty, param_tys, ret_ty) = match &method_ty { | 1399 | let (expected_receiver_ty, param_tys, ret_ty) = match &method_ty { |
1400 | Ty::FnPtr(sig) => { | 1400 | Ty::FnPtr(sig) => { |
1401 | if sig.input.len() > 0 { | 1401 | if !sig.input.is_empty() { |
1402 | ( | 1402 | ( |
1403 | sig.input[0].clone(), | 1403 | sig.input[0].clone(), |
1404 | sig.input[1..].iter().cloned().collect(), | 1404 | sig.input[1..].to_vec(), |
1405 | sig.output.clone(), | 1405 | sig.output.clone(), |
1406 | ) | 1406 | ) |
1407 | } else { | 1407 | } else { |
@@ -1411,7 +1411,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
1411 | Ty::FnDef { substs, sig, .. } => { | 1411 | Ty::FnDef { substs, sig, .. } => { |
1412 | let ret_ty = sig.output.clone().subst(&substs); | 1412 | let ret_ty = sig.output.clone().subst(&substs); |
1413 | 1413 | ||
1414 | if sig.input.len() > 0 { | 1414 | if !sig.input.is_empty() { |
1415 | let mut arg_iter = sig.input.iter().map(|ty| ty.clone().subst(&substs)); | 1415 | let mut arg_iter = sig.input.iter().map(|ty| ty.clone().subst(&substs)); |
1416 | let receiver_ty = arg_iter.next().unwrap(); | 1416 | let receiver_ty = arg_iter.next().unwrap(); |
1417 | (receiver_ty, arg_iter.collect(), ret_ty) | 1417 | (receiver_ty, arg_iter.collect(), ret_ty) |