only lint public stutter namings

This commit is contained in:
Oliver Schneider
2016-06-10 16:14:36 +02:00
parent 8356d2fb21
commit 7253ce73bb

View File

@@ -135,6 +135,7 @@ impl EarlyLintPass for EnumVariantNames {
let item_name = item.ident.name.as_str();
let item_name_chars = item_name.chars().count();
let item_camel = to_camel_case(&item_name);
if item.vis == Visibility::Public {
if !in_macro(cx, item.span) {
if let Some(mod_camel) = self.modules.last() {
// constants don't have surrounding modules
@@ -151,6 +152,7 @@ impl EarlyLintPass for EnumVariantNames {
}
}
}
}
if let ItemKind::Enum(ref def, _) = item.node {
check_variant(cx, def, &item_name, item_name_chars, item.span);
}