@@ -573,8 +573,7 @@ config_data! {
573573 /// List of cfg options to enable with the given values.
574574 cargo_cfgs: Vec <String > = {
575575 vec![ "debug_assertion" . into( ) , "miri" . into( ) ]
576- }
577- ,
576+ } ,
578577 /// Extra arguments that are passed to every cargo invocation.
579578 cargo_extraArgs: Vec <String > = vec![ ] ,
580579 /// Extra environment variables that will be set when running cargo, rustc
@@ -1942,17 +1941,13 @@ impl Config {
19421941 global : CfgDiff :: new (
19431942 self . cargo_cfgs ( source_root)
19441943 . 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| {
19471946 let mut sp = s. splitn ( 2 , "=" ) ;
19481947 let key = sp. next ( ) ;
19491948 let val = sp. next ( ) ;
1950- ( key, val)
1949+ key . map ( | key| ( key , val) )
19511950 } )
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) )
19561951 . map ( |( key, val) | match val {
19571952 Some ( val) => CfgAtom :: KeyValue {
19581953 key : Symbol :: intern ( key) ,
0 commit comments