Skip to content

Commit

Permalink
Rollup merge of #81095 - LingMan:unwrap, r=oli-obk
Browse files Browse the repository at this point in the history
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
  • Loading branch information
m-ou-se committed Jan 16, 2021
2 parents 6b66591 + 5a706cf commit 576c3d5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 576c3d5

Please sign in to comment.