Skip to content

Commit 576c3d5

Browse files
authored
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
2 parents 6b66591 + 5a706cf commit 576c3d5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,7 @@ fn handle_native(name: &str) -> &str {
214214
}
215215

216216
pub fn target_cpu(sess: &Session) -> &str {
217-
let name = match sess.opts.cg.target_cpu {
218-
Some(ref s) => &**s,
219-
None => &*sess.target.cpu,
220-
};
221-
217+
let name = sess.opts.cg.target_cpu.as_ref().unwrap_or(&sess.target.cpu);
222218
handle_native(name)
223219
}
224220

0 commit comments

Comments
 (0)