diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 40559c3de7..268d2c1104 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs @@ -57,21 +57,11 @@ pub fn infer(db: &impl HirDatabase, func: Function) -> Arc { #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] enum ExprOrPatId { - Expr(ExprId), - Pat(PatId), + ExprId(ExprId), + PatId(PatId), } -impl From for ExprOrPatId { - fn from(id: ExprId) -> Self { - ExprOrPatId::Expr(id) - } -} - -impl From for ExprOrPatId { - fn from(id: PatId) -> Self { - ExprOrPatId::Pat(id) - } -} +impl_froms!(ExprOrPatId: ExprId, PatId); /// The result of type inference: A mapping from expressions and patterns to types. #[derive(Clone, PartialEq, Eq, Debug)]