diff options
| author | klensy <klensy@users.noreply.github.com> | 2021-02-24 01:02:05 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2021-02-24 02:43:35 +0300 |
| commit | c75c4a579bdea69fc9b93697aa2531daf82540fc (patch) | |
| tree | 625a3f482229b40902893946eb17acebb6051371 /compiler/rustc_codegen_llvm/src/debuginfo/mod.rs | |
| parent | 5ff1be197eaa8a014718b26b1fcbe0ced33b6e1a (diff) | |
| download | rust-c75c4a579bdea69fc9b93697aa2531daf82540fc.tar.gz rust-c75c4a579bdea69fc9b93697aa2531daf82540fc.zip | |
replaced some map_or with map_or_else
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo/mod.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs index 955e739b2c1..21585bf77a0 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs @@ -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 } |
