From 55d5e835e4bf59d253d8ad080e8fa82551cc8985 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 19 Apr 2020 15:18:29 +0900 Subject: [PATCH] Fix/suppress clippy warnings --- src/mapping.rs | 8 ++++---- src/mismatch.rs | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mapping.rs b/src/mapping.rs index f0902245..11a2ba37 100644 --- a/src/mapping.rs +++ b/src/mapping.rs @@ -48,10 +48,10 @@ impl Hash for InherentEntry { // FIXME derive Hash again once AssocKind derives Hash again. match self.kind { - AssocKind::Const => 0u8.hash(hasher), - AssocKind::Fn => 1u8.hash(hasher), - AssocKind::OpaqueTy => 2u8.hash(hasher), - AssocKind::Type => 3u8.hash(hasher), + AssocKind::Const => 0_u8.hash(hasher), + AssocKind::Fn => 1_u8.hash(hasher), + AssocKind::OpaqueTy => 2_u8.hash(hasher), + AssocKind::Type => 3_u8.hash(hasher), } self.name.hash(hasher); diff --git a/src/mismatch.rs b/src/mismatch.rs index 523dbf5e..10e71b08 100644 --- a/src/mismatch.rs +++ b/src/mismatch.rs @@ -129,6 +129,8 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> { Relate::relate(self, a, b) } + // Allow this since that lint is too pedantic here. + #[allow(clippy::similar_names)] fn tys(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) -> RelateResult<'tcx, Ty<'tcx>> { use rustc_middle::ty::TyKind;