From 9401a6744debe1245767d0c0f21dbb023c78a954 Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Thu, 11 Apr 2019 23:53:59 +0200 Subject: [PATCH] save-analysis: Simplify match arm for type node def --- src/librustc_save_analysis/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index 9b21e42bf3870..d6923b4490d59 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -647,6 +647,10 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> { Node::Pat(&hir::Pat { node: hir::PatKind::TupleStruct(ref qpath, ..), .. + }) | + Node::Ty(&hir::Ty { + node: hir::TyKind::Path(ref qpath), + .. }) => { let hir_id = self.tcx.hir().node_to_hir_id(id); self.tables.qpath_def(qpath, hir_id) @@ -657,11 +661,6 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> { .. }) => HirDef::Local(self.tcx.hir().hir_to_node_id(canonical_id)), - Node::Ty(&hir::Ty { node: hir::TyKind::Path(ref qpath), .. } ) => { - let hir_id = self.tcx.hir().node_to_hir_id(id); - self.tables.qpath_def(qpath, hir_id) - }, - _ => HirDef::Err, } }