save-analysis: Simplify match arm for type node def

This commit is contained in:
Igor Matuszewski 2019-04-11 23:53:59 +02:00
parent 1ced262653
commit bcd263e1f1

View File

@ -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,
}
}