mirror of
https://github.com/fluencelabs/marine-rs-sdk-test
synced 2025-06-03 10:01:24 +00:00
turn Option to Vec for output_type
This commit is contained in:
parent
53299c7c5a
commit
1cbe8c3bfa
@ -31,7 +31,7 @@ pub struct FnSignature {
|
|||||||
pub arguments: Vec<FnArgument>,
|
pub arguments: Vec<FnArgument>,
|
||||||
// fce supports only one return value now,
|
// fce supports only one return value now,
|
||||||
// waiting for adding multi-value support in Wasmer.
|
// waiting for adding multi-value support in Wasmer.
|
||||||
pub output_type: Option<ParsedType>,
|
pub output_type: Vec<ParsedType>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Serialize, Deserialize)]
|
||||||
@ -157,11 +157,15 @@ impl From<AstFnSignature> for FnSignature {
|
|||||||
fn from(ast_fn_sig: AstFnSignature) -> Self {
|
fn from(ast_fn_sig: AstFnSignature) -> Self {
|
||||||
// TODO: consider to do transmute here in case of optimization issues.
|
// TODO: consider to do transmute here in case of optimization issues.
|
||||||
let arguments = ast_fn_sig.arguments.into_iter().map(Into::into).collect();
|
let arguments = ast_fn_sig.arguments.into_iter().map(Into::into).collect();
|
||||||
|
let output_type = match ast_fn_sig.output_type {
|
||||||
|
Some(output_type) => vec![output_type],
|
||||||
|
None => Vec::new(),
|
||||||
|
};
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
name: ast_fn_sig.name,
|
name: ast_fn_sig.name,
|
||||||
arguments,
|
arguments,
|
||||||
output_type: ast_fn_sig.output_type,
|
output_type,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user