mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-03 10:40:03 +00:00
Refactor detect-targets
(#636)
* Enable dep guess_host_triple for any non-linux OS * Refactor: Rm `{windows, macos}::detect_target_*` * Refactor `detect_targets` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
0ecb30dc9d
commit
59d79d1573
4 changed files with 31 additions and 45 deletions
|
@ -1,6 +1,3 @@
|
|||
use crate::TARGET;
|
||||
use guess_host_triple::guess_host_triple;
|
||||
|
||||
const AARCH64: &str = "aarch64-apple-darwin";
|
||||
const X86: &str = "x86_64-apple-darwin";
|
||||
const UNIVERSAL: &str = "universal-apple-darwin";
|
||||
|
@ -15,11 +12,3 @@ pub(super) fn detect_alternative_targets(target: &str) -> impl Iterator<Item = S
|
|||
.flatten()
|
||||
.map(ToString::to_string)
|
||||
}
|
||||
|
||||
pub(super) fn detect_targets_macos() -> Vec<String> {
|
||||
let mut targets = vec![guess_host_triple().unwrap_or(TARGET).to_string()];
|
||||
|
||||
targets.extend(detect_alternative_targets(&targets[0]));
|
||||
|
||||
targets
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue