mirror of
https://github.com/fluencelabs/marine-rs-sdk-test
synced 2024-12-04 23:30:18 +00:00
fix bug with f32 mapping, allow dead code in the logger
This commit is contained in:
parent
a38d88a094
commit
689c389cc7
@ -80,6 +80,7 @@ pub struct WasmLogger {
|
||||
level: log::Level,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
impl WasmLogger {
|
||||
/// Initializes the global logger with a [`WasmLogger`] instance, sets
|
||||
/// `max_log_level` to a given log level.
|
||||
|
@ -134,7 +134,7 @@ impl ParsedType {
|
||||
"u32" => Ok(ParsedType::U32),
|
||||
"u64" => Ok(ParsedType::U64),
|
||||
"f32" => Ok(ParsedType::F32),
|
||||
"f64" => Ok(ParsedType::F32),
|
||||
"f64" => Ok(ParsedType::F64),
|
||||
"bool" => Ok(ParsedType::Boolean),
|
||||
"String" => Ok(ParsedType::Utf8String),
|
||||
"Vec" => match parse_vec_bracket(&type_segment.arguments) {
|
||||
|
@ -45,7 +45,7 @@ impl RecordDeserializerGlueCodeGenerator for fce_ast_types::AstRecordItem {
|
||||
let field_d = match &ast_field.ty {
|
||||
ParsedType::Boolean => {
|
||||
quote! {
|
||||
let #field = raw_record[#value_id] as bool;
|
||||
let #field = raw_record[#value_id] != 0;
|
||||
}
|
||||
}
|
||||
ParsedType::I8 => {
|
||||
@ -95,7 +95,7 @@ impl RecordDeserializerGlueCodeGenerator for fce_ast_types::AstRecordItem {
|
||||
}
|
||||
ParsedType::F64 => {
|
||||
quote! {
|
||||
let #field = f64::from_bits(raw_record[#value_id as _]);
|
||||
let #field = f64::from_bits(raw_record[#value_id]);
|
||||
}
|
||||
}
|
||||
ParsedType::Utf8String => {
|
||||
|
Loading…
Reference in New Issue
Block a user