@@ -139,18 +139,6 @@ impl<'a> Toolchain<'a> {
139
139
Ok ( ( ) )
140
140
}
141
141
142
- // Custom and Distributable, Installed and not installed.
143
- // Perhaps make into a helper?
144
- fn install_if_not_installed ( & self , install_method : InstallMethod < ' _ > ) -> Result < UpdateStatus > {
145
- assert ! ( self . is_valid_install_method( install_method) ) ;
146
- ( self . cfg . notify_handler ) ( Notification :: LookingForToolchain ( & self . name ) ) ;
147
- if !self . exists ( ) {
148
- Ok ( install_method. install ( & self ) ?)
149
- } else {
150
- ( self . cfg . notify_handler ) ( Notification :: UsingExistingToolchain ( & self . name ) ) ;
151
- Ok ( UpdateStatus :: Unchanged )
152
- }
153
- }
154
142
// Custom and Distributable. Installed and not installed (because of install_from_dist_if_not_installed) Goes away?
155
143
// Or perhaps a trait.
156
144
pub fn is_valid_install_method ( & self , install_method : InstallMethod < ' _ > ) -> bool {
@@ -750,18 +738,25 @@ impl<'a> DistributableToolchain<'a> {
750
738
// Installed or not installed.
751
739
pub fn install_from_dist_if_not_installed ( & self ) -> Result < UpdateStatus > {
752
740
let update_hash = self . update_hash ( ) ?;
753
- self . 0 . install_if_not_installed ( InstallMethod :: Dist (
754
- & self . desc ( ) ?,
755
- self . 0 . cfg . get_profile ( ) ?,
756
- Some ( & update_hash) ,
757
- self . 0 . download_cfg ( ) ,
758
- false ,
759
- false ,
760
- false ,
761
- None ,
762
- & [ ] ,
763
- & [ ] ,
764
- ) )
741
+ ( self . 0 . cfg . notify_handler ) ( Notification :: LookingForToolchain ( & self . 0 . name ) ) ;
742
+ if !self . 0 . exists ( ) {
743
+ Ok ( InstallMethod :: Dist (
744
+ & self . desc ( ) ?,
745
+ self . 0 . cfg . get_profile ( ) ?,
746
+ Some ( & update_hash) ,
747
+ self . 0 . download_cfg ( ) ,
748
+ false ,
749
+ false ,
750
+ false ,
751
+ None ,
752
+ & [ ] ,
753
+ & [ ] ,
754
+ )
755
+ . install ( & self . 0 ) ?)
756
+ } else {
757
+ ( self . 0 . cfg . notify_handler ) ( Notification :: UsingExistingToolchain ( & self . 0 . name ) ) ;
758
+ Ok ( UpdateStatus :: Unchanged )
759
+ }
765
760
}
766
761
767
762
// Installed only.
0 commit comments