Open UnlimitedCookies opened 1 month ago
Hi, it would be awesome to be able to also tuple serialize enum with fields in to json lists/tuples, where the first field is the name of the variant.
example:
#[derive(Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum Action { Rule{pos: u16, rule_index: u16}, Cut{start_index: u16, end_index: u16} }
currently (de)serializes to {"rule":{"pos":0,"rule_index":0}} but I'd much rather have ["rule",0,0].
{"rule":{"pos":0,"rule_index":0}}
["rule",0,0]
I think this would work and would probably be a good addition, if you would like to work on it! Currently this library only works with structs with named fields.
Hi, it would be awesome to be able to also tuple serialize enum with fields in to json lists/tuples, where the first field is the name of the variant.
example:
currently (de)serializes to
{"rule":{"pos":0,"rule_index":0}}
but I'd much rather have["rule",0,0]
.