Skip to content

Commit ffd28e6

Browse files
committed
Fix cargo config get env parsing
1 parent d2fe906 commit ffd28e6

File tree

1 file changed

+7
-4
lines changed
  • crates/project-model/src

1 file changed

+7
-4
lines changed

crates/project-model/src/env.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,13 @@ fn parse_output_cargo_config_env(stdout: String) -> FxHashMap<String, String> {
9090
stdout
9191
.lines()
9292
.filter_map(|l| l.strip_prefix("env."))
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 = "))
93+
.filter_map(|l| l.split_once(" = "))
94+
.filter_map(|(k, v)| {
95+
if k.contains('.') {
96+
k.strip_suffix(".value").zip(Some(v))
97+
} else {
98+
Some((k, v))
99+
}
97100
})
98101
.map(|(key, value)| (key.to_owned(), value.trim_matches('"').to_owned()))
99102
.collect()

0 commit comments

Comments
 (0)