File tree Expand file tree Collapse file tree 1 file changed +14
-22
lines changed Expand file tree Collapse file tree 1 file changed +14
-22
lines changed Original file line number Diff line number Diff line change @@ -1016,28 +1016,20 @@ async fn show(cfg: &Cfg<'_>, verbose: bool) -> Result<utils::ExitCode> {
1016
1016
. map ( |atar| ( & atar. 0 , & atar. 1 ) )
1017
1017
. unzip ( ) ;
1018
1018
1019
- let active_toolchain_targets: Vec < TargetTriple > = active_toolchain_name
1020
- . and_then ( |atn| match atn {
1021
- ToolchainName :: Official ( desc) => DistributableToolchain :: new ( cfg, desc. clone ( ) )
1022
- . ok ( )
1023
- . and_then ( |distributable| distributable. components ( ) . ok ( ) )
1024
- . map ( |cs_vec| {
1025
- cs_vec
1026
- . into_iter ( )
1027
- . filter ( |c| {
1028
- c. installed && c. component . short_name_in_manifest ( ) == "rust-std"
1029
- } )
1030
- . map ( |c| c. component . target . expect ( "rust-std should have a target" ) )
1031
- . collect ( )
1032
- } ) ,
1033
- ToolchainName :: Custom ( name) => {
1034
- Toolchain :: new ( cfg, LocalToolchainName :: Named ( name. into ( ) ) )
1035
- . ok ( ) ?
1036
- . installed_targets ( )
1037
- . ok ( )
1038
- }
1039
- } )
1040
- . unwrap_or_default ( ) ;
1019
+ let active_toolchain_targets = match active_toolchain_name {
1020
+ Some ( ToolchainName :: Official ( desc) ) => DistributableToolchain :: new ( cfg, desc. clone ( ) ) ?
1021
+ . components ( ) ?
1022
+ . into_iter ( )
1023
+ . filter_map ( |c| {
1024
+ ( c. installed && c. component . short_name_in_manifest ( ) == "rust-std" )
1025
+ . then ( || c. component . target . expect ( "rust-std should have a target" ) )
1026
+ } )
1027
+ . collect ( ) ,
1028
+ Some ( ToolchainName :: Custom ( name) ) => {
1029
+ Toolchain :: new ( cfg, LocalToolchainName :: Named ( name. into ( ) ) ) ?. installed_targets ( ) ?
1030
+ }
1031
+ None => Vec :: new ( ) ,
1032
+ } ;
1041
1033
1042
1034
// show installed toolchains
1043
1035
{
You can’t perform that action at this time.
0 commit comments