File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -782,7 +782,8 @@ fn check_updates(cfg: &Cfg) -> Result<()> {
782
782
for channel in channels {
783
783
match channel {
784
784
( ref name, Ok ( ref toolchain) ) => {
785
- let current_version = toolchain. show_version ( ) ?;
785
+ let distributable = DistributableToolchain :: new ( & toolchain) ?;
786
+ let current_version = distributable. show_version ( ) ?;
786
787
let dist_version = toolchain. show_dist_version ( ) ?;
787
788
let _ = t. attr ( term2:: Attr :: Bold ) ;
788
789
write ! ( t, "{} - " , name) ?;
Original file line number Diff line number Diff line change @@ -496,14 +496,6 @@ impl<'a> Toolchain<'a> {
496
496
} )
497
497
}
498
498
// Distributable only. Installed only.
499
- pub fn show_version ( & self ) -> Result < Option < String > > {
500
- let distributable = DistributableToolchain :: new ( & self ) ?;
501
- match distributable. get_manifest ( ) ? {
502
- Some ( manifest) => Ok ( Some ( manifest. get_rust_version ( ) ?. to_string ( ) ) ) ,
503
- None => Ok ( None ) ,
504
- }
505
- }
506
- // Distributable only. Installed only.
507
499
pub fn show_dist_version ( & self ) -> Result < Option < String > > {
508
500
let update_hash = self . update_hash ( ) ?;
509
501
@@ -860,7 +852,7 @@ impl<'a> DistributableToolchain<'a> {
860
852
}
861
853
862
854
// Installed only.
863
- pub fn get_manifest ( & self ) -> Result < Option < Manifest > > {
855
+ fn get_manifest ( & self ) -> Result < Option < Manifest > > {
864
856
if !self . 0 . exists ( ) {
865
857
return Err ( ErrorKind :: ToolchainNotInstalled ( self . 0 . name ( ) . to_owned ( ) ) . into ( ) ) ;
866
858
}
@@ -897,4 +889,12 @@ impl<'a> DistributableToolchain<'a> {
897
889
targets,
898
890
) )
899
891
}
892
+
893
+ // Installed only.
894
+ pub fn show_version ( & self ) -> Result < Option < String > > {
895
+ match self . get_manifest ( ) ? {
896
+ Some ( manifest) => Ok ( Some ( manifest. get_rust_version ( ) ?. to_string ( ) ) ) ,
897
+ None => Ok ( None ) ,
898
+ }
899
+ }
900
900
}
You can’t perform that action at this time.
0 commit comments