about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-01-17 12:24:58 +0000
committerGitHub <noreply@github.com>2021-01-17 12:24:58 +0000
commit34e073f44b09c319cdbf139adda8e3d6348046be (patch)
tree7447b6430957bada75d75c379d8c50446ce70e96 /compiler/rustc_codegen_llvm/src
parent366f97bf8cb6268ae5624c6422f05fd7e8eaf698 (diff)
parent76003f31f100b96b7c5f6d2414dde5088394b5bd (diff)
downloadrust-34e073f44b09c319cdbf139adda8e3d6348046be.tar.gz
rust-34e073f44b09c319cdbf139adda8e3d6348046be.zip
Rollup merge of #81084 - LingMan:map, r=oli-obk
Use Option::map instead of open-coding it

r? ```@oli-obk```
```@rustbot``` modify labels +C-cleanup +T-compiler
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm_util.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs
index 6c2a871e520..26843670131 100644
--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs
@@ -254,8 +254,6 @@ pub fn handle_native_features(sess: &Session) -> Vec<String> {
 }
 
 pub fn tune_cpu(sess: &Session) -> Option<&str> {
-    match sess.opts.debugging_opts.tune_cpu {
-        Some(ref s) => Some(handle_native(&**s)),
-        None => None,
-    }
+    let name = sess.opts.debugging_opts.tune_cpu.as_ref()?;
+    Some(handle_native(name))
 }