File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -87,11 +87,8 @@ impl Cfg {
8787 } ) ,
8888 } ,
8989 MetaItemKind :: List ( ref items) => {
90- let sub_cfgs = items. iter ( ) . filter_map ( |i| match Cfg :: parse_nested ( i, exclude) {
91- Ok ( Some ( c) ) => Some ( Ok ( c) ) ,
92- Err ( e) => Some ( Err ( e) ) ,
93- _ => None ,
94- } ) ;
90+ let sub_cfgs =
91+ items. iter ( ) . filter_map ( |i| Cfg :: parse_nested ( i, exclude) . transpose ( ) ) ;
9592 let ret = match name {
9693 sym:: all => sub_cfgs. fold ( Ok ( Cfg :: True ) , |x, y| Ok ( x? & y?) ) ,
9794 sym:: any => sub_cfgs. fold ( Ok ( Cfg :: False ) , |x, y| Ok ( x? | y?) ) ,
Original file line number Diff line number Diff line change @@ -831,9 +831,8 @@ impl AttributesExt for [ast::Attribute] {
831831 self . iter ( )
832832 . filter ( |attr| attr. has_name ( sym:: cfg) )
833833 . filter_map ( |attr| single ( attr. meta_item_list ( ) ?) )
834- . filter_map ( |attr| match Cfg :: parse_without ( attr. meta_item ( ) ?, hidden_cfg) {
835- Ok ( Some ( c) ) => Some ( c) ,
836- _ => None ,
834+ . filter_map ( |attr| {
835+ Cfg :: parse_without ( attr. meta_item ( ) ?, hidden_cfg) . ok ( ) . flatten ( )
837836 } )
838837 . fold ( Cfg :: True , |cfg, new_cfg| cfg & new_cfg)
839838 } else {
You can’t perform that action at this time.
0 commit comments