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
This commit is contained in:
Yuki Okushi 2021-01-15 18:26:14 +09:00 committed by GitHub
commit a584d87417
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 67 additions and 79 deletions

View file

@ -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);