mirror of
https://github.com/danog/ext-php-rs.git
synced 2024-11-30 04:39:04 +01:00
Merge pull request #153 from joehoyle/add-name-function-macro
Add ability to set function name on php_function macro
This commit is contained in:
commit
73902ef017
@ -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