mirror of
https://github.com/danog/ext-php-rs.git
synced 2024-11-26 20:15:22 +01:00
Add ability to set function name on php_function macro
This is much the same as `php_class(name="ABC")`
This commit is contained in:
parent
199962ce3f
commit
18ede97712
@ -17,6 +17,7 @@ pub struct AttrArgs {
|
||||
optional: Option<String>,
|
||||
ignore_module: bool,
|
||||
defaults: HashMap<String, Lit>,
|
||||
name: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@ -93,7 +94,7 @@ pub fn parser(args: AttributeArgs, input: ItemFn) -> Result<(TokenStream, Functi
|
||||
}
|
||||
|
||||
let function = Function {
|
||||
name: ident.to_string(),
|
||||
name: attr_args.name.unwrap_or_else(|| ident.to_string()),
|
||||
docs: get_docs(&input.attrs),
|
||||
ident: internal_ident.to_string(),
|
||||
args,
|
||||
|
Loading…
Reference in New Issue
Block a user