From 4ad9e986ad05e404df73701c098b71f73a847ca6 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Thu, 4 Jul 2019 13:26:44 -0400 Subject: Some clippy fixes for 1.36 --- crates/ra_hir/src/ty/infer.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'crates/ra_hir/src/ty/infer.rs') diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index a2dc92370..9228dd314 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs @@ -116,16 +116,16 @@ pub struct InferenceResult { impl InferenceResult { pub fn method_resolution(&self, expr: ExprId) -> Option { - self.method_resolutions.get(&expr).map(|it| *it) + self.method_resolutions.get(&expr).copied() } pub fn field_resolution(&self, expr: ExprId) -> Option { - self.field_resolutions.get(&expr).map(|it| *it) + self.field_resolutions.get(&expr).copied() } pub fn assoc_resolutions_for_expr(&self, id: ExprId) -> Option { - self.assoc_resolutions.get(&id.into()).map(|it| *it) + self.assoc_resolutions.get(&id.into()).copied() } pub fn assoc_resolutions_for_pat(&self, id: PatId) -> Option { - self.assoc_resolutions.get(&id.into()).map(|it| *it) + self.assoc_resolutions.get(&id.into()).copied() } pub(crate) fn add_diagnostics( &self, @@ -239,8 +239,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { &self.resolver, type_ref, ); - let ty = self.insert_type_vars(ty); - ty + self.insert_type_vars(ty) } fn unify_substs(&mut self, substs1: &Substs, substs2: &Substs, depth: usize) -> bool { @@ -973,8 +972,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { for (arg_pat, arg_type) in args.iter().zip(arg_types.iter()) { let expected = if let Some(type_ref) = arg_type { - let ty = self.make_ty(type_ref); - ty + self.make_ty(type_ref) } else { Ty::Unknown }; -- cgit v1.2.3