@@ -3,7 +3,6 @@ use cargo_lambda_interactive::{
33 progress:: Progress ,
44} ;
55use miette:: { IntoDiagnostic , Result , WrapErr } ;
6- use rustc_version:: Channel ;
76use std:: { env, str} ;
87
98use crate :: target_arch:: TargetArch ;
@@ -13,16 +12,8 @@ use crate::target_arch::TargetArch;
1312pub async fn check_target_component_with_rustc_meta ( target_arch : & TargetArch ) -> Result < ( ) > {
1413 let component = target_arch. rustc_target_without_glibc_version ( ) ;
1514
16- // convert `Channel` enum to a lower-cased string representation
17- let toolchain = match target_arch. channel ( ) ? {
18- Channel :: Stable => "stable" ,
19- Channel :: Nightly => "nightly" ,
20- Channel :: Dev => "dev" ,
21- Channel :: Beta => "beta" ,
22- } ;
23-
2415 let cmd = rustup_cmd ( ) ;
25- let args = [ & format ! ( "+{toolchain}" ) , "target" , "list" , "--installed" ] ;
16+ let args = [ "target" , "list" , "--installed" ] ;
2617
2718 tracing:: trace!(
2819 cmd = ?cmd,
@@ -49,7 +40,7 @@ pub async fn check_target_component_with_rustc_meta(target_arch: &TargetArch) ->
4940 // install target component using `rustup`
5041 let pb = Progress :: start ( format ! ( "Installing target component `{component}`..." ) ) ;
5142
52- let result = install_target_component ( component, toolchain ) . await ;
43+ let result = install_target_component ( component) . await ;
5344 let finish = if result. is_ok ( ) {
5445 "Target component installed"
5546 } else {
@@ -63,9 +54,9 @@ pub async fn check_target_component_with_rustc_meta(target_arch: &TargetArch) ->
6354}
6455
6556/// Install target component in the host toolchain, using `rustup target add`
66- async fn install_target_component ( component : & str , toolchain : & str ) -> Result < ( ) > {
57+ async fn install_target_component ( component : & str ) -> Result < ( ) > {
6758 let cmd = rustup_cmd ( ) ;
68- let args = [ & format ! ( "+{toolchain}" ) , "target" , "add" , component] ;
59+ let args = [ "target" , "add" , component] ;
6960 tracing:: trace!(
7061 cmd = ?cmd,
7162 args = ?args,
0 commit comments