Hi guys!
I get an UnsupportedType error when serializing an Enum to TOML:
The enum
looks like this:
#[derive(Copy, Clone, Debug, Serialize)]
pub enum TheEnum {
Var1(usize),
Var2(usize),
}
and it is in a struct:
#[derive(Clone, Copy, Debug, Serialize)]
pub struct Metadata {
config: TheEnum,
}
and then, serializing:
use toml::Value;
let result = Value::try_from(#something of Metadata Type#)?;
And then it fails when it does the Value::try_from
, because apparently the TOML format does not support enums with values.
What should I do to make the struct Metadata
serialized into TOML?