mirror of
https://github.com/fluencelabs/marine-rs-sdk-test
synced 2024-12-04 15:20:18 +00:00
fix usage of the debug feature
This commit is contained in:
parent
5dc680c046
commit
9775ca6144
@ -46,7 +46,7 @@ pub use result::set_result_size;
|
||||
#[allow(unused_variables)]
|
||||
pub(crate) fn log<S: AsRef<str>>(msg: S) {
|
||||
// logs will be printed only if debug feature is enabled
|
||||
#[cfg(debug)]
|
||||
#[cfg(feature = "debug")]
|
||||
unsafe {
|
||||
let msg = msg.as_ref();
|
||||
logger::log_utf8_string(msg.as_ptr() as _, msg.len() as _);
|
||||
|
@ -210,22 +210,4 @@ impl ParsedType {
|
||||
ParsedType::Utf8String | ParsedType::ByteVector | ParsedType::Record(_) => true,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_raw_types(&self) -> Vec<WasmType> {
|
||||
match self {
|
||||
ParsedType::Boolean
|
||||
| ParsedType::I8
|
||||
| ParsedType::I16
|
||||
| ParsedType::I32
|
||||
| ParsedType::U8
|
||||
| ParsedType::U16
|
||||
| ParsedType::U32 => vec![WasmType::I32],
|
||||
ParsedType::I64 | ParsedType::U64 => vec![WasmType::I64],
|
||||
ParsedType::F32 => vec![WasmType::F32],
|
||||
ParsedType::F64 => vec![WasmType::F64],
|
||||
ParsedType::Utf8String | ParsedType::ByteVector | ParsedType::Record(_) => {
|
||||
vec![WasmType::I32, WasmType::I32]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,20 @@ pub(crate) trait FnArgGlueCodeGenerator {
|
||||
|
||||
impl FnArgGlueCodeGenerator for ParsedType {
|
||||
fn generate_arguments(&self) -> Vec<WasmType> {
|
||||
self.to_raw_types()
|
||||
match self {
|
||||
ParsedType::Boolean
|
||||
| ParsedType::I8
|
||||
| ParsedType::I16
|
||||
| ParsedType::I32
|
||||
| ParsedType::U8
|
||||
| ParsedType::U16
|
||||
| ParsedType::U32 => vec![WasmType::I32],
|
||||
ParsedType::I64 | ParsedType::U64 => vec![WasmType::I64],
|
||||
ParsedType::F32 => vec![WasmType::F32],
|
||||
ParsedType::F64 => vec![WasmType::F64],
|
||||
ParsedType::Utf8String | ParsedType::ByteVector | ParsedType::Record(_) => {
|
||||
vec![WasmType::I32, WasmType::I32]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user