This commit is contained in:
Stephen Chung 2022-03-18 14:03:29 +08:00
commit 61ef115ecb

View File

@ -774,14 +774,14 @@ impl ExportedFn {
syn::Type::Path(ref p) if p.path == string_type_path => {
is_string = true;
is_ref = false;
quote_spanned!(arg_type.span() =>
quote_spanned!(arg_type.span().resolved_at(Span::call_site()) =>
mem::take(args[#i]).into_string().unwrap()
)
}
_ => {
is_string = false;
is_ref = false;
quote_spanned!(arg_type.span() =>
quote_spanned!(arg_type.span().resolved_at(Span::call_site()) =>
mem::take(args[#i]).cast::<#arg_type>()
)
}