File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -787,24 +787,26 @@ impl<'a> Cfg<'a> {
787
787
) -> Result < Toolchain < ' _ > > {
788
788
let components: Vec < _ > = components. iter ( ) . map ( AsRef :: as_ref) . collect ( ) ;
789
789
let targets: Vec < _ > = targets. iter ( ) . map ( AsRef :: as_ref) . collect ( ) ;
790
+ let profile = match profile {
791
+ Some ( profile) => profile,
792
+ None => self . get_profile ( ) ?,
793
+ } ;
790
794
let toolchain = match DistributableToolchain :: new ( self , toolchain. clone ( ) ) {
791
795
Err ( RustupError :: ToolchainNotInstalled ( _) ) => {
792
796
DistributableToolchain :: install (
793
797
self ,
794
798
& toolchain,
795
799
& components,
796
800
& targets,
797
- profile. unwrap_or ( Profile :: Default ) ,
801
+ profile,
798
802
false ,
799
803
)
800
804
. await ?
801
805
. 1
802
806
}
803
807
Ok ( mut distributable) => {
804
808
if !distributable. components_exist ( & components, & targets) ? {
805
- distributable
806
- . update ( & components, & targets, profile. unwrap_or ( Profile :: Default ) )
807
- . await ?;
809
+ distributable. update ( & components, & targets, profile) . await ?;
808
810
}
809
811
distributable
810
812
}
You can’t perform that action at this time.
0 commit comments