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/metadata.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/metadata.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/metadata.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/metadata.rs b/compiler/rustc_codegen_llvm/src/metadata.rs index 3912d6a3a48..ca973222cca 100644 --- a/compiler/rustc_codegen_llvm/src/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/metadata.rs @@ -65,8 +65,8 @@ fn search_meta_section<'a>( while llvm::LLVMIsSectionIteratorAtEnd(of.llof, si.llsi) == False { let mut name_buf = None; let name_len = llvm::LLVMRustGetSectionName(si.llsi, &mut name_buf); - let name = name_buf.map_or( - String::new(), // We got a NULL ptr, ignore `name_len`. + let name = name_buf.map_or_else( + || String::new(), // We got a NULL ptr, ignore `name_len`. |buf| { String::from_utf8( slice::from_raw_parts(buf.as_ptr() as *const u8, name_len as usize) |
