mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-25 19:35:06 +00:00
fix: requested changed
This commit is contained in:
parent
e9a13ab6d7
commit
cc7fb1945d
1 changed files with 4 additions and 9 deletions
|
@ -573,8 +573,7 @@ config_data! {
|
|||
/// List of cfg options to enable with the given values.
|
||||
cargo_cfgs: Vec<String> = {
|
||||
vec!["debug_assertion".into(), "miri".into()]
|
||||
}
|
||||
,
|
||||
},
|
||||
/// Extra arguments that are passed to every cargo invocation.
|
||||
cargo_extraArgs: Vec<String> = vec![],
|
||||
/// Extra environment variables that will be set when running cargo, rustc
|
||||
|
@ -1942,17 +1941,13 @@ impl Config {
|
|||
global: CfgDiff::new(
|
||||
self.cargo_cfgs(source_root)
|
||||
.iter()
|
||||
// parse any cfg setting formatted as key=value
|
||||
.map(|s| {
|
||||
// parse any cfg setting formatted as key=value or just key (without value)
|
||||
.filter_map(|s| {
|
||||
let mut sp = s.splitn(2, "=");
|
||||
let key = sp.next();
|
||||
let val = sp.next();
|
||||
(key, val)
|
||||
key.map(|key| (key, val))
|
||||
})
|
||||
// we filter out anything with a None key
|
||||
.filter(|(key, _)| key.is_some())
|
||||
// unwrap cannot panic here as we are sure key is Some
|
||||
.map(|(key, val)| (key.unwrap(), val))
|
||||
.map(|(key, val)| match val {
|
||||
Some(val) => CfgAtom::KeyValue {
|
||||
key: Symbol::intern(key),
|
||||
|
|
Loading…
Reference in a new issue