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 {
2153
2153
fn is_cfg_test ( attr : & Attribute ) -> bool {
2154
2154
if attr. has_name ( sym:: cfg)
2155
2155
&& 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)
2158
2158
{
2159
2159
true
2160
2160
} else {
@@ -2163,7 +2163,8 @@ pub fn is_in_cfg_test(tcx: TyCtxt<'_>, id: hir::HirId) -> bool {
2163
2163
}
2164
2164
tcx. hir ( )
2165
2165
. 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)
2167
2168
}
2168
2169
2169
2170
/// Checks whether item either has `test` attribute applied, or
You can’t perform that action at this time.
0 commit comments