rustbuild: Less panics in musl_root
Don't panic if the target wasn't configured.
This commit is contained in:
parent
9cb01365ee
commit
651bb69ecd
1 changed files with 2 additions and 1 deletions
|
|
@ -991,7 +991,8 @@ impl Build {
|
|||
|
||||
/// Returns the "musl root" for this `target`, if defined
|
||||
fn musl_root(&self, target: &str) -> Option<&Path> {
|
||||
self.config.target_config[target].musl_root.as_ref()
|
||||
self.config.target_config.get(target)
|
||||
.and_then(|t| t.musl_root.as_ref())
|
||||
.or(self.config.musl_root.as_ref())
|
||||
.map(|p| &**p)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue