diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2021-01-15 18:26:14 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-15 18:26:14 +0900 |
| commit | a584d874172b85d854f2e4d2a3256f7c23e3183a (patch) | |
| tree | a19e9e1e49c0735828c8ababae5bacb827ce814c /compiler/rustc_codegen_llvm | |
| parent | 1b8fd02daab85e129f0dda9c92ea11aaa14b7485 (diff) | |
| parent | a56bffb4f9d6f7791b2fa40412bd3e0549d76cc3 (diff) | |
| download | rust-a584d874172b85d854f2e4d2a3256f7c23e3183a.tar.gz rust-a584d874172b85d854f2e4d2a3256f7c23e3183a.zip | |
Rollup merge of #80944 - LingMan:map_or, r=nagisa
Use Option::map_or instead of `.map(..).unwrap_or(..)` ``@rustbot`` modify labels +C-cleanup +T-compiler
Diffstat (limited to 'compiler/rustc_codegen_llvm')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/write.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index 68f319ade1e..e225730dce0 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -1002,8 +1002,7 @@ pub unsafe fn with_llvm_pmb( // reasonable defaults and prepare it to actually populate the pass // manager. let builder = llvm::LLVMPassManagerBuilderCreate(); - let opt_size = - config.opt_size.map(|x| to_llvm_opt_settings(x).1).unwrap_or(llvm::CodeGenOptSizeNone); + let opt_size = config.opt_size.map_or(llvm::CodeGenOptSizeNone, |x| to_llvm_opt_settings(x).1); let inline_threshold = config.inline_threshold; let pgo_gen_path = get_pgo_gen_path(config); let pgo_use_path = get_pgo_use_path(config); |
