Skip to content

Commit

Permalink
Parse function argument type first so it can be used to determine name
Browse files Browse the repository at this point in the history
  • Loading branch information
gerard-ryan-immersaview authored and emilio committed May 28, 2024
1 parent 62b06e3 commit 6f13a5d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/bindgen/ir/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ impl SynFnArgHelpers for syn::FnArg {
syn::FnArg::Typed(syn::PatType {
ref pat, ref ty, ..
}) => {
let ty = match Type::load(ty)? {
Some(x) => x,
None => return Ok(None),
};
let name = match **pat {
syn::Pat::Wild(..) => None,
syn::Pat::Ident(syn::PatIdent { ref ident, .. }) => {
Expand All @@ -251,10 +255,6 @@ impl SynFnArgHelpers for syn::FnArg {
))
}
};
let ty = match Type::load(ty)? {
Some(x) => x,
None => return Ok(None),
};
if let Type::Array(..) = ty {
return Err("Array as function arguments are not supported".to_owned());
}
Expand Down

0 comments on commit 6f13a5d

Please sign in to comment.