mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 22:30:03 +00:00
Verify target triple retrieved from rustc
is valid (#637)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
287ae03a51
commit
31c9d4de1d
1 changed files with 2 additions and 0 deletions
|
@ -95,4 +95,6 @@ async fn get_target_from_rustc() -> Option<String> {
|
||||||
.lines()
|
.lines()
|
||||||
.filter_map(|line| line.ok())
|
.filter_map(|line| line.ok())
|
||||||
.find_map(|line| line.strip_prefix("host: ").map(|host| host.to_owned()))
|
.find_map(|line| line.strip_prefix("host: ").map(|host| host.to_owned()))
|
||||||
|
// All valid target triple must be in the form of $arch-$os-$abi.
|
||||||
|
.filter(|target| target.split('-').count() >= 3)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue