fix bug with f32 mapping, allow dead code in the logger

This commit is contained in:
vms 2020-07-27 00:02:33 +03:00
parent a38d88a094
commit 689c389cc7
3 changed files with 4 additions and 3 deletions

View File

@ -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.

View File

@ -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) {

View File

@ -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 => {