Skip to content

Commit 6ce5ce8

Browse files
committed
Cleanup after some refactoring in rustc_target
1 parent 88c058b commit 6ce5ce8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,10 @@ fn handle_native(name: &str) -> &str {
287287
}
288288

289289
pub fn target_cpu(sess: &Session) -> &str {
290-
let name = sess.opts.cg.target_cpu.as_ref().unwrap_or(&sess.target.cpu);
291-
handle_native(name)
290+
match sess.opts.cg.target_cpu {
291+
Some(ref name) => handle_native(name),
292+
None => handle_native(sess.target.cpu.as_ref()),
293+
}
292294
}
293295

294296
pub fn target_features(sess: &Session) -> Vec<Symbol> {

0 commit comments

Comments
 (0)