remove some dead fields from FnArg
This commit is contained in:
parent
39edeebf67
commit
a5d97b3ad0
|
@ -13,8 +13,6 @@ use syn::Result;
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct FnArg<'a> {
|
pub struct FnArg<'a> {
|
||||||
pub name: &'a syn::Ident,
|
pub name: &'a syn::Ident,
|
||||||
pub by_ref: &'a Option<syn::token::Ref>,
|
|
||||||
pub mutability: &'a Option<syn::token::Mut>,
|
|
||||||
pub ty: &'a syn::Type,
|
pub ty: &'a syn::Type,
|
||||||
pub optional: Option<&'a syn::Type>,
|
pub optional: Option<&'a syn::Type>,
|
||||||
pub default: Option<syn::Expr>,
|
pub default: Option<syn::Expr>,
|
||||||
|
@ -37,20 +35,13 @@ impl<'a> FnArg<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let arg_attrs = PyFunctionArgPyO3Attributes::from_attrs(&mut cap.attrs)?;
|
let arg_attrs = PyFunctionArgPyO3Attributes::from_attrs(&mut cap.attrs)?;
|
||||||
let (ident, by_ref, mutability) = match &*cap.pat {
|
let ident = match &*cap.pat {
|
||||||
syn::Pat::Ident(syn::PatIdent {
|
syn::Pat::Ident(syn::PatIdent { ident, .. }) => ident,
|
||||||
ident,
|
|
||||||
by_ref,
|
|
||||||
mutability,
|
|
||||||
..
|
|
||||||
}) => (ident, by_ref, mutability),
|
|
||||||
other => return Err(handle_argument_error(other)),
|
other => return Err(handle_argument_error(other)),
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(FnArg {
|
Ok(FnArg {
|
||||||
name: ident,
|
name: ident,
|
||||||
by_ref,
|
|
||||||
mutability,
|
|
||||||
ty: &cap.ty,
|
ty: &cap.ty,
|
||||||
optional: utils::option_type_argument(&cap.ty),
|
optional: utils::option_type_argument(&cap.ty),
|
||||||
default: None,
|
default: None,
|
||||||
|
|
Loading…
Reference in a new issue