@@ -573,8 +573,7 @@ config_data! {
573
573
/// List of cfg options to enable with the given values.
574
574
cargo_cfgs: Vec <String > = {
575
575
vec![ "debug_assertion" . into( ) , "miri" . into( ) ]
576
- }
577
- ,
576
+ } ,
578
577
/// Extra arguments that are passed to every cargo invocation.
579
578
cargo_extraArgs: Vec <String > = vec![ ] ,
580
579
/// Extra environment variables that will be set when running cargo, rustc
@@ -1942,17 +1941,13 @@ impl Config {
1942
1941
global : CfgDiff :: new (
1943
1942
self . cargo_cfgs ( source_root)
1944
1943
. iter ( )
1945
- // parse any cfg setting formatted as key=value
1946
- . map ( |s| {
1944
+ // parse any cfg setting formatted as key=value or just key (without value)
1945
+ . filter_map ( |s| {
1947
1946
let mut sp = s. splitn ( 2 , "=" ) ;
1948
1947
let key = sp. next ( ) ;
1949
1948
let val = sp. next ( ) ;
1950
- ( key, val)
1949
+ key . map ( | key| ( key , val) )
1951
1950
} )
1952
- // we filter out anything with a None key
1953
- . filter ( |( key, _) | key. is_some ( ) )
1954
- // unwrap cannot panic here as we are sure key is Some
1955
- . map ( |( key, val) | ( key. unwrap ( ) , val) )
1956
1951
. map ( |( key, val) | match val {
1957
1952
Some ( val) => CfgAtom :: KeyValue {
1958
1953
key : Symbol :: intern ( key) ,
0 commit comments