@@ -1084,14 +1084,7 @@ fn show(cfg: &Cfg, m: &ArgMatches) -> Result<utils::ExitCode> {
1084
1084
// active_toolchain will carry the reason we don't have one in its detail.
1085
1085
let active_targets = if let Ok ( ref at) = active_toolchain {
1086
1086
if let Ok ( distributable) = DistributableToolchain :: try_from ( & at. 0 ) {
1087
- let components = ( || {
1088
- let manifestation = distributable. get_manifestation ( ) ?;
1089
- let config = manifestation. read_config ( ) ?. unwrap_or_default ( ) ;
1090
- let manifest = distributable. get_manifest ( ) ?;
1091
- manifest. query_components ( distributable. desc ( ) , & config)
1092
- } ) ( ) ;
1093
-
1094
- match components {
1087
+ match distributable. components ( ) {
1095
1088
Ok ( cs_vec) => cs_vec
1096
1089
. into_iter ( )
1097
1090
. filter ( |c| c. component . short_name_in_manifest ( ) == "rust-std" )
@@ -1277,11 +1270,7 @@ fn target_add(cfg: &Cfg, m: &ArgMatches) -> Result<utils::ExitCode> {
1277
1270
// list_components *and* add_component would both be inappropriate for
1278
1271
// custom toolchains.
1279
1272
let distributable = DistributableToolchain :: try_from ( & toolchain) ?;
1280
- let manifestation = distributable. get_manifestation ( ) ?;
1281
- let config = manifestation. read_config ( ) ?. unwrap_or_default ( ) ;
1282
- let manifest = distributable. get_manifest ( ) ?;
1283
- let components = manifest. query_components ( distributable. desc ( ) , & config) ?;
1284
-
1273
+ let components = distributable. components ( ) ?;
1285
1274
let mut targets: Vec < _ > = m
1286
1275
. get_many :: < String > ( "target" )
1287
1276
. unwrap ( )
@@ -1554,11 +1543,8 @@ fn doc(cfg: &Cfg, m: &ArgMatches) -> Result<utils::ExitCode> {
1554
1543
let toolchain = explicit_desc_or_dir_toolchain ( cfg, m) ?;
1555
1544
1556
1545
if let Ok ( distributable) = DistributableToolchain :: try_from ( & toolchain) {
1557
- let manifestation = distributable. get_manifestation ( ) ?;
1558
- let config = manifestation. read_config ( ) ?. unwrap_or_default ( ) ;
1559
- let manifest = distributable. get_manifest ( ) ?;
1560
- let components = manifest. query_components ( distributable. desc ( ) , & config) ?;
1561
- if let [ _] = components
1546
+ if let [ _] = distributable
1547
+ . components ( ) ?
1562
1548
. into_iter ( )
1563
1549
. filter ( |cstatus| {
1564
1550
cstatus. component . short_name_in_manifest ( ) == "rust-docs" && !cstatus. installed
0 commit comments