-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
liquid-rust version: "0.26.4"
rust version: rustc 1.75.0 (82e1608df 2023-12-21)
OS: Ubuntu 22.04.3 LTS
Does liquid-rust support 64 bit unsigned integers? Should it?
Attempting to populate a template with an Option<u64> results in the following error "Cannot fit number"
Result::unwrap()
on anErr` value: Error { inner: InnerError { msg: "Cannot fit number", user_backtrace: [Trace { trace: None, context: [] }], cause: None } }
But when the u64 is changed to u32, the error does not occur.
This error is triggered when calling liquid::to_object(¶meters).unwrap(); with a parameter struct that contains a u64. In this case ¶meters is of the TemplateParameters type as defined below.
#[derive(Debug,Serialize,Clone)]
struct Field {
name : String,
typename : String,
size : u8,
start_index : u16,
end_index : u16,
value_override : Option<u64>
}
#[derive(Debug,Serialize,Clone)]
struct Message {
name : String,
fields : Vec<Field>,
msg_type : MsgType,
fport : u8,
length : u8
}
#[derive(Serialize)]
struct TemplateParameters {
name: String,
all_messages: Vec<Message>,
downlinks: Vec<Message>,
uplinks: Vec<Message>
}
Metadata
Metadata
Assignees
Labels
No labels