File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -85,10 +85,14 @@ pub fn active_toolchain(msg_info: &mut MessageInfo) -> Result<String> {
85
85
86
86
pub fn installed_toolchains ( msg_info : & mut MessageInfo ) -> Result < Vec < String > > {
87
87
let out = rustup_command ( msg_info, true )
88
- . args ( [ "toolchain" , "list" , "--quiet" ] ) // suppress " (active, default)" suffix
88
+ . args ( [ "toolchain" , "list" ] ) // --quiet would be available from 1.28.0
89
89
. run_and_get_stdout ( msg_info) ?;
90
90
91
- Ok ( out. lines ( ) . map ( |l| l. trim ( ) . to_owned ( ) ) . collect ( ) )
91
+ // Emulate --quiet by removing suffixes like " (active, default)" or " (override)" manually
92
+ Ok ( out
93
+ . lines ( )
94
+ . map ( |l| l. split_once ( " (" ) . map_or ( l. trim ( ) , |( a, _) | a) . to_owned ( ) )
95
+ . collect ( ) )
92
96
}
93
97
94
98
pub fn available_targets (
You can’t perform that action at this time.
0 commit comments