replaced some map_or with map_or_else
This commit is contained in:
parent
5ff1be197e
commit
c75c4a579b
12 changed files with 82 additions and 70 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue