diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-01-17 12:24:59 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-17 12:24:59 +0000 |
| commit | 7e2425ab73b40f042975a0911a976220bf62d083 (patch) | |
| tree | d21700054bdc8b18f37bfa55c01e960a5370d5f4 /compiler/rustc_codegen_llvm | |
| parent | 34e073f44b09c319cdbf139adda8e3d6348046be (diff) | |
| parent | 5a706cfc49295f67c01fd3d422fa6fa69a018d92 (diff) | |
| download | rust-7e2425ab73b40f042975a0911a976220bf62d083.tar.gz rust-7e2425ab73b40f042975a0911a976220bf62d083.zip | |
Rollup merge of #81095 - LingMan:unwrap, r=oli-obk
Use Option::unwrap_or instead of open-coding it r? ```@oli-obk``` Noticed this while we were talking about the other PR just now 😆 ```@rustbot``` modify labels +C-cleanup +T-compiler
Diffstat (limited to 'compiler/rustc_codegen_llvm')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm_util.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs index 26843670131..544ef38c12c 100644 --- a/compiler/rustc_codegen_llvm/src/llvm_util.rs +++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs @@ -214,11 +214,7 @@ fn handle_native(name: &str) -> &str { } pub fn target_cpu(sess: &Session) -> &str { - let name = match sess.opts.cg.target_cpu { - Some(ref s) => &**s, - None => &*sess.target.cpu, - }; - + let name = sess.opts.cg.target_cpu.as_ref().unwrap_or(&sess.target.cpu); handle_native(name) } |
