Format components debugger and deny_public_fields #21373

This commit is contained in:
kingdido999 2018-09-01 09:44:53 +08:00
parent 577830de90
commit e203cde9be
2 changed files with 24 additions and 18 deletions

View file

@ -14,8 +14,10 @@ decl_derive!([DenyPublicFields] => deny_public_fields_derive);
fn deny_public_fields_derive(s: synstructure::Structure) -> proc_macro::TokenStream {
s.each(|binding| {
if binding.ast().vis != syn::Visibility::Inherited {
panic!("Field `{}` should not be public",
binding.ast().ident.as_ref().unwrap_or(&binding.binding));
panic!(
"Field `{}` should not be public",
binding.ast().ident.as_ref().unwrap_or(&binding.binding)
);
}
"".to_owned()