1
Fork 0

replaced some map_or with map_or_else

This commit is contained in:
klensy 2021-02-24 01:02:05 +03:00
parent 5ff1be197e
commit c75c4a579b
12 changed files with 82 additions and 70 deletions

View file

@ -481,9 +481,10 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
}
fn get_parameter_names(cx: &CodegenCx<'_, '_>, generics: &ty::Generics) -> Vec<Symbol> {
let mut names = generics
.parent
.map_or(vec![], |def_id| get_parameter_names(cx, cx.tcx.generics_of(def_id)));
let mut names = generics.parent.map_or_else(
|| vec![],
|def_id| get_parameter_names(cx, cx.tcx.generics_of(def_id)),
);
names.extend(generics.params.iter().map(|param| param.name));
names
}