about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-04-01 23:50:45 +0200
committerMatthias Krüger <matthias.krueger@famsik.de>2023-04-01 23:50:45 +0200
commit5a07e33d2cc57d929bbd50a22cad703d4c666fc2 (patch)
tree2b0fa4ab1d9210a2a45d57b8e47aea8ededce0b4 /compiler/rustc_codegen_llvm/src
parentac229c281981129003cfcf6ef894bb7655b0d466 (diff)
downloadrust-5a07e33d2cc57d929bbd50a22cad703d4c666fc2.tar.gz
rust-5a07e33d2cc57d929bbd50a22cad703d4c666fc2.zip
use and_then/flat_map for map().flatten()
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/common.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/common.rs b/compiler/rustc_codegen_llvm/src/common.rs
index efa0c13226e..4f8b5abd901 100644
--- a/compiler/rustc_codegen_llvm/src/common.rs
+++ b/compiler/rustc_codegen_llvm/src/common.rs
@@ -378,8 +378,7 @@ pub(crate) fn get_dllimport<'tcx>(
     name: &str,
 ) -> Option<&'tcx DllImport> {
     tcx.native_library(id)
-        .map(|lib| lib.dll_imports.iter().find(|di| di.name.as_str() == name))
-        .flatten()
+        .and_then(|lib| lib.dll_imports.iter().find(|di| di.name.as_str() == name))
 }
 
 pub(crate) fn is_mingw_gnu_toolchain(target: &Target) -> bool {