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> {
8585
8686pub fn installed_toolchains ( msg_info : & mut MessageInfo ) -> Result < Vec < String > > {
8787 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
8989 . run_and_get_stdout ( msg_info) ?;
9090
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 ( ) )
9296}
9397
9498pub fn available_targets (
You can’t perform that action at this time.
0 commit comments