Skip to content

Commit

Permalink
Use Option::unwrap_or instead of open-coding it
Browse files Browse the repository at this point in the history
  • Loading branch information
LingMan committed Jan 16, 2021
1 parent efdb859 commit 5a706cf
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 5a706cf

Please sign in to comment.