Use Option::map_or instead of .map(..).unwrap_or(..)
This commit is contained in:
parent
d03fe84169
commit
a56bffb4f9
50 changed files with 67 additions and 79 deletions
|
@ -166,7 +166,7 @@ fn get_linker(
|
|||
_ => match flavor {
|
||||
LinkerFlavor::Lld(f) => Command::lld(linker, f),
|
||||
LinkerFlavor::Msvc if sess.opts.cg.linker.is_none() && sess.target.linker.is_none() => {
|
||||
Command::new(msvc_tool.as_ref().map(|t| t.path()).unwrap_or(linker))
|
||||
Command::new(msvc_tool.as_ref().map_or(linker, |t| t.path()))
|
||||
}
|
||||
_ => Command::new(linker),
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue