@@ -4,8 +4,7 @@ use darling::{FromAttributes, ToTokens};
4
4
use proc_macro2:: { Ident , Span , TokenStream } ;
5
5
use quote:: { format_ident, quote} ;
6
6
use syn:: spanned:: Spanned as _;
7
- use syn:: PatType ;
8
- use syn:: { FnArg , GenericArgument , ItemFn , Lit , PathArguments , Type , TypePath } ;
7
+ use syn:: { Expr , FnArg , GenericArgument , ItemFn , PatType , PathArguments , Type , TypePath } ;
9
8
10
9
use crate :: helpers:: get_docs;
11
10
use crate :: parsing:: { PhpRename , Visibility } ;
@@ -28,7 +27,7 @@ pub fn wrap(input: &syn::Path) -> Result<TokenStream> {
28
27
struct PhpFunctionAttribute {
29
28
#[ darling( flatten) ]
30
29
rename : PhpRename ,
31
- defaults : HashMap < Ident , Lit > ,
30
+ defaults : HashMap < Ident , Expr > ,
32
31
optional : Option < Ident > ,
33
32
vis : Option < Visibility > ,
34
33
attrs : Vec < syn:: Attribute > ,
@@ -381,7 +380,7 @@ pub struct TypedArg<'a> {
381
380
pub name : & ' a Ident ,
382
381
pub ty : Type ,
383
382
pub nullable : bool ,
384
- pub default : Option < Lit > ,
383
+ pub default : Option < Expr > ,
385
384
pub as_ref : bool ,
386
385
pub variadic : bool ,
387
386
}
@@ -395,7 +394,7 @@ pub struct Args<'a> {
395
394
impl < ' a > Args < ' a > {
396
395
pub fn parse_from_fnargs (
397
396
args : impl Iterator < Item = & ' a FnArg > ,
398
- mut defaults : HashMap < Ident , Lit > ,
397
+ mut defaults : HashMap < Ident , Expr > ,
399
398
) -> Result < Self > {
400
399
let mut result = Self {
401
400
receiver : None ,
0 commit comments