mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Use Option::unwrap_or instead of open-coding it
This commit is contained in:
parent
efdb859dcd
commit
5a706cfc49
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user