6 ms·
I think a bigger one from what I have looked is the complexity of (en^de)code bytes around. I suspect if you could use UNION better and be the same as Enum in
by mamcx 4y ago
I think a bigger one from what I have looked is the complexity of (en^de)code bytes around.
I suspect if you could use UNION better and be the same as Enum in Rust you could do us a favor! Also I wish I could do this easily:
enum Tag {
Int,
Bool
}
enum Data {
Int(Vec<i32>),
Bool(Vec<bool>)
}
struct Val {
tag:Tag,
data:Data
}
let n = val.as_i32::<Tag::Int>(&self) -> Vec<i32>
- celeritascelery 4y agoThere are some crates that let you do that. For example enum-ptr https://crates.io/crates/enum-ptr https://crates.io/crates/enum-ptr