@@ -1115,8 +1115,8 @@ fn show(cfg: &Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCode> {
11151115 } ;
11161116
11171117 let show_installed_toolchains = installed_toolchains. len ( ) > 1 ;
1118- let show_active_targets = active_targets. len ( ) > 1 ;
11191118 let show_active_toolchain = true ;
1119+ let show_active_targets = active_targets. len ( ) > 1 ;
11201120
11211121 // Only need to display headers if we have multiple sections
11221122 let show_headers = [
@@ -1158,26 +1158,6 @@ fn show(cfg: &Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCode> {
11581158 } ;
11591159 }
11601160
1161- if show_active_targets {
1162- let mut t = term2:: stdout ( ) ;
1163- if show_headers {
1164- print_header :: < Error > ( & mut t, "installed targets for active toolchain" ) ?;
1165- }
1166- for at in active_targets {
1167- writeln ! (
1168- t,
1169- "{}" ,
1170- at. component
1171- . target
1172- . as_ref( )
1173- . expect( "rust-std should have a target" )
1174- ) ?;
1175- }
1176- if show_headers {
1177- writeln ! ( t) ?;
1178- } ;
1179- }
1180-
11811161 if show_active_toolchain {
11821162 let mut t = term2:: stdout ( ) ;
11831163 if show_headers {
@@ -1214,6 +1194,26 @@ fn show(cfg: &Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCode> {
12141194 }
12151195 }
12161196
1197+ if show_active_targets {
1198+ let mut t = term2:: stdout ( ) ;
1199+ if show_headers {
1200+ print_header :: < Error > ( & mut t, "installed targets for active toolchain" ) ?;
1201+ }
1202+ for at in active_targets {
1203+ writeln ! (
1204+ t,
1205+ "{}" ,
1206+ at. component
1207+ . target
1208+ . as_ref( )
1209+ . expect( "rust-std should have a target" )
1210+ ) ?;
1211+ }
1212+ if show_headers {
1213+ writeln ! ( t) ?;
1214+ } ;
1215+ }
1216+
12171217 fn print_header < E > ( t : & mut term2:: StdoutTerminal , s : & str ) -> std:: result:: Result < ( ) , E >
12181218 where
12191219 E : From < term:: Error > + From < std:: io:: Error > ,
0 commit comments