File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/tools/rust-analyzer/crates/project-model/src Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -75,14 +75,26 @@ pub(crate) fn cargo_config_env(
7575 }
7676 // if successful we receive `env.key.value = "value" per entry
7777 tracing:: debug!( "Discovering cargo config env by {:?}" , cargo_config) ;
78- utf8_stdout ( cargo_config) . map ( parse_output_cargo_config_env) . unwrap_or_default ( )
78+ utf8_stdout ( cargo_config)
79+ . map ( parse_output_cargo_config_env)
80+ . inspect ( |env| {
81+ tracing:: debug!( "Discovered cargo config env: {:?}" , env) ;
82+ } )
83+ . inspect_err ( |err| {
84+ tracing:: error!( "Failed to discover cargo config env: {:?}" , err) ;
85+ } )
86+ . unwrap_or_default ( )
7987}
8088
8189fn parse_output_cargo_config_env ( stdout : String ) -> FxHashMap < String , String > {
8290 stdout
8391 . lines ( )
8492 . filter_map ( |l| l. strip_prefix ( "env." ) )
85- . filter_map ( |l| l. split_once ( ".value = " ) )
93+ . filter_map ( |l| {
94+ l. split_once ( " = " )
95+ // cargo used to report it with this, keep it for a couple releases around
96+ . or_else ( || l. split_once ( ".value = " ) )
97+ } )
8698 . map ( |( key, value) | ( key. to_owned ( ) , value. trim_matches ( '"' ) . to_owned ( ) ) )
8799 . collect ( )
88100}
You can’t perform that action at this time.
0 commit comments