File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -2153,8 +2153,8 @@ pub fn is_in_cfg_test(tcx: TyCtxt<'_>, id: hir::HirId) -> bool {
21532153 fn is_cfg_test ( attr : & Attribute ) -> bool {
21542154 if attr. has_name ( sym:: cfg)
21552155 && let Some ( items) = attr. meta_item_list ( )
2156- && items . len ( ) == 1
2157- && items [ 0 ] . has_name ( sym:: test)
2156+ && let [ item ] = & * items
2157+ && item . has_name ( sym:: test)
21582158 {
21592159 true
21602160 } else {
@@ -2163,7 +2163,8 @@ pub fn is_in_cfg_test(tcx: TyCtxt<'_>, id: hir::HirId) -> bool {
21632163 }
21642164 tcx. hir ( )
21652165 . parent_iter ( id)
2166- . any ( |( parent_id, _) | tcx. hir ( ) . attrs ( parent_id) . iter ( ) . any ( is_cfg_test) )
2166+ . flat_map ( |( parent_id, _) | tcx. hir ( ) . attrs ( parent_id) )
2167+ . any ( is_cfg_test)
21672168}
21682169
21692170/// Checks whether item either has `test` attribute applied, or
You can’t perform that action at this time.
0 commit comments