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
This commit is contained in:
commit
7e2425ab73
1 changed files with 1 additions and 5 deletions
|
@ -214,11 +214,7 @@ fn handle_native(name: &str) -> &str {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn target_cpu(sess: &Session) -> &str {
|
pub fn target_cpu(sess: &Session) -> &str {
|
||||||
let name = match sess.opts.cg.target_cpu {
|
let name = sess.opts.cg.target_cpu.as_ref().unwrap_or(&sess.target.cpu);
|
||||||
Some(ref s) => &**s,
|
|
||||||
None => &*sess.target.cpu,
|
|
||||||
};
|
|
||||||
|
|
||||||
handle_native(name)
|
handle_native(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue