Skip to content

Commit 3272277

Browse files
committed
fixup no_{core,std} handling code
1 parent 0df12d7 commit 3272277

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

clippy_utils/src/lib.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,17 +2133,11 @@ pub fn std_or_core(cx: &LateContext<'_>) -> Option<&'static str> {
21332133
}
21342134

21352135
pub fn is_no_std_crate(cx: &LateContext<'_>) -> bool {
2136-
cx.tcx
2137-
.hir_attrs(hir::CRATE_HIR_ID)
2138-
.iter()
2139-
.any(|attr| attr.has_name(sym::no_std))
2136+
find_attr!(cx.tcx.hir_attrs(hir::CRATE_HIR_ID), AttributeKind::NoStd(..))
21402137
}
21412138

21422139
pub fn is_no_core_crate(cx: &LateContext<'_>) -> bool {
2143-
cx.tcx
2144-
.hir_attrs(hir::CRATE_HIR_ID)
2145-
.iter()
2146-
.any(|attr| attr.has_name(sym::no_core))
2140+
find_attr!(cx.tcx.hir_attrs(hir::CRATE_HIR_ID), AttributeKind::NoCore(..))
21472141
}
21482142

21492143
/// Check if parent of a hir node is a trait implementation block.

0 commit comments

Comments
 (0)