mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 14:13:58 +00:00
Fix cargo config get env parsing
This commit is contained in:
parent
d2fe906a62
commit
ffd28e6ee9
1 changed files with 7 additions and 4 deletions
|
@ -90,10 +90,13 @@ fn parse_output_cargo_config_env(stdout: String) -> FxHashMap<String, String> {
|
||||||
stdout
|
stdout
|
||||||
.lines()
|
.lines()
|
||||||
.filter_map(|l| l.strip_prefix("env."))
|
.filter_map(|l| l.strip_prefix("env."))
|
||||||
.filter_map(|l| {
|
.filter_map(|l| l.split_once(" = "))
|
||||||
l.split_once(" = ")
|
.filter_map(|(k, v)| {
|
||||||
// cargo used to report it with this, keep it for a couple releases around
|
if k.contains('.') {
|
||||||
.or_else(|| l.split_once(".value = "))
|
k.strip_suffix(".value").zip(Some(v))
|
||||||
|
} else {
|
||||||
|
Some((k, v))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.map(|(key, value)| (key.to_owned(), value.trim_matches('"').to_owned()))
|
.map(|(key, value)| (key.to_owned(), value.trim_matches('"').to_owned()))
|
||||||
.collect()
|
.collect()
|
||||||
|
|
Loading…
Reference in a new issue