1
Fork 0

let generate_field_attrs_code create FieldInfo

this simplifies the code inside the `structure.each` closure argument
and allows to remove the `vis` field from `FieldInfo`.
This commit is contained in:
Christian Poveda 2022-05-19 00:47:45 -05:00
parent 7e9be9240c
commit d839d2ecc2
No known key found for this signature in database
GPG key ID: 27525EF5E7420A50
3 changed files with 14 additions and 46 deletions

View file

@ -4,7 +4,7 @@ use proc_macro2::TokenStream;
use quote::{format_ident, quote, ToTokens};
use std::collections::BTreeSet;
use std::str::FromStr;
use syn::{spanned::Spanned, Attribute, Meta, Type, TypeTuple, Visibility};
use syn::{spanned::Spanned, Attribute, Meta, Type, TypeTuple};
use synstructure::BindingInfo;
/// Checks whether the type name of `ty` matches `name`.
@ -158,7 +158,6 @@ impl<'ty> FieldInnerTy<'ty> {
/// Field information passed to the builder. Deliberately omits attrs to discourage the
/// `generate_*` methods from walking the attributes themselves.
pub(crate) struct FieldInfo<'a> {
pub(crate) vis: &'a Visibility,
pub(crate) binding: &'a BindingInfo<'a>,
pub(crate) ty: &'a Type,
pub(crate) span: &'a proc_macro2::Span,