Rename get_targets_from_rustc to get_target_from_rustc

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-06-07 12:11:04 +10:00
parent 1d71f92ee6
commit 95b7c4f771
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -68,7 +68,7 @@ impl<'a> IntoIterator for &'a Targets {
/// Check [this issue](https://github.com/ryankurte/cargo-binstall/issues/155)
/// for more information.
pub async fn detect_targets() -> Targets {
if let Some(target) = get_targets_from_rustc().await {
if let Some(target) = get_target_from_rustc().await {
let mut v = Targets::from_array([target]);
#[cfg(target_os = "linux")]
@ -99,7 +99,7 @@ pub async fn detect_targets() -> Targets {
}
// Figure out what the host target is, from rustc or from this program's own build target
async fn get_targets_from_rustc() -> Option<Box<str>> {
async fn get_target_from_rustc() -> Option<Box<str>> {
match Command::new("rustc").arg("-vV").output().await {
Ok(Output { status, stdout, .. }) if status.success() => Cursor::new(stdout)
.lines()