mirror of
https://github.com/fluencelabs/marine-rs-sdk-test
synced 2024-12-04 15:20:18 +00:00
rename is_integral_type to a is_complex_type
This commit is contained in:
parent
0c09b32bb7
commit
057be9a9b7
@ -189,7 +189,7 @@ impl ParsedType {
|
||||
.into()
|
||||
}
|
||||
|
||||
pub fn is_integral_type(&self) -> bool {
|
||||
pub fn is_complex_type(&self) -> bool {
|
||||
match self {
|
||||
ParsedType::Boolean
|
||||
| ParsedType::I8
|
||||
|
@ -94,7 +94,7 @@ fn generate_return_expression(ty: &Option<ParsedType>) -> proc_macro2::TokenStre
|
||||
fn generate_epilog(ty: &Option<ParsedType>) -> proc_macro2::TokenStream {
|
||||
match ty {
|
||||
None => quote!(),
|
||||
Some(ty) if !ty.is_integral_type() => quote! {
|
||||
Some(ty) if !ty.is_complex_type() => quote! {
|
||||
return result as _;
|
||||
},
|
||||
Some(ParsedType::Record(record_name)) => {
|
||||
@ -105,7 +105,7 @@ fn generate_epilog(ty: &Option<ParsedType>) -> proc_macro2::TokenStream {
|
||||
fluence::internal::set_result_ptr(result_ptr as _);
|
||||
}
|
||||
}
|
||||
Some(ty) if ty.is_integral_type() => quote! {
|
||||
Some(ty) if ty.is_complex_type() => quote! {
|
||||
fluence::internal::set_result_ptr(result.as_ptr() as _);
|
||||
fluence::internal::set_result_size(result.len() as _);
|
||||
std::mem::forget(result);
|
||||
|
@ -88,7 +88,7 @@ fn generate_type_prolog(
|
||||
let generated_arg_id = new_ident!(format!("converted_arg_{}", generated_arg_id));
|
||||
|
||||
match ty {
|
||||
ty if !ty.is_integral_type() => {
|
||||
ty if !ty.is_complex_type() => {
|
||||
let supplied_arg_start_id = new_ident!(format!("arg_{}", supplied_arg_start_id));
|
||||
quote! {
|
||||
let #generated_arg_id = #supplied_arg_start_id as _;
|
||||
|
@ -41,7 +41,7 @@ impl ForeignModEpilogGlueCodeGenerator for Option<ParsedType> {
|
||||
fn generate_wrapper_epilog(&self) -> proc_macro2::TokenStream {
|
||||
match self {
|
||||
None => quote!(),
|
||||
Some(ty) if !ty.is_integral_type() => quote! {
|
||||
Some(ty) if !ty.is_complex_type() => quote! {
|
||||
return result as _;
|
||||
},
|
||||
Some(ParsedType::Utf8String) => quote! {
|
||||
|
Loading…
Reference in New Issue
Block a user