return;
}
- match it.node {
+ match it.kind {
ast::ItemKind::TyAlias(..) |
ast::ItemKind::Enum(..) |
ast::ItemKind::Struct(..) |
.and_then(|attr| attr.meta())
.and_then(|meta| {
meta.name_value_literal().and_then(|lit| {
- if let ast::LitKind::Str(name, ..) = lit.node {
+ if let ast::LitKind::Str(name, ..) = lit.kind {
// Discard the double quotes surrounding the literal.
let sp = cx.sess().source_map().span_to_snippet(lit.span)
.ok()
}
fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
- if let hir::ItemKind::Mod(_) = it.node {
+ if let hir::ItemKind::Mod(_) = it.kind {
self.check_snake_case(cx, "module", &it.ident);
}
}
fn check_trait_item(&mut self, cx: &LateContext<'_, '_>, item: &hir::TraitItem) {
- if let hir::TraitItemKind::Method(_, hir::TraitMethod::Required(pnames)) = &item.node {
+ if let hir::TraitItemKind::Method(_, hir::TraitMethod::Required(pnames)) = &item.kind {
self.check_snake_case(cx, "trait method", &item.ident);
for param_name in pnames {
self.check_snake_case(cx, "variable", param_name);
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals {
fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
- match it.node {
+ match it.kind {
hir::ItemKind::Static(..) if !attr::contains_name(&it.attrs, sym::no_mangle) => {
NonUpperCaseGlobals::check_upper_case(cx, "static variable", &it.ident);
}
}
fn check_trait_item(&mut self, cx: &LateContext<'_, '_>, ti: &hir::TraitItem) {
- if let hir::TraitItemKind::Const(..) = ti.node {
+ if let hir::TraitItemKind::Const(..) = ti.kind {
NonUpperCaseGlobals::check_upper_case(cx, "associated constant", &ti.ident);
}
}