Simplify some match statements on `DefPathDataName'

This commit is contained in:
marmeladema 2020-09-01 13:11:28 +01:00
parent 75130b06bf
commit bb8e1764bb
3 changed files with 5 additions and 22 deletions

View file

@ -26,7 +26,7 @@ use rustc_errors::{struct_span_err, Applicability};
use rustc_hir as hir;
use rustc_hir::def::Res;
use rustc_hir::def_id::{CrateNum, DefId};
use rustc_hir::definitions::{DefPathData, DefPathDataName, DisambiguatedDefPathData};
use rustc_hir::definitions::{DefPathData, DisambiguatedDefPathData};
use rustc_middle::lint::LintDiagnosticBuilder;
use rustc_middle::middle::privacy::AccessLevels;
use rustc_middle::middle::stability;
@ -846,12 +846,7 @@ impl<'tcx> LateContext<'tcx> {
return Ok(path);
}
path.push(match disambiguated_data.data.name() {
DefPathDataName::Named(name) => name,
DefPathDataName::Anon { namespace } => {
Symbol::intern(&format!("{{{{{}}}}}", namespace))
}
});
path.push(Symbol::intern(&disambiguated_data.data.to_string()));
Ok(path)
}