Firstly, thank you for your work on this crate! It's very helpful & useful. 😃
Currently, the following will not compile with Nestify:
nest! {
#[derive(Debug, Clone)]*
pub(crate) struct Item {
pub(crate) id: u16,
pub(crate) category:
#[derive(Copy, PartialEq, Eq)]*
pub(crate) enum ItemCategory {
Item(
#[derive(Deserialize)] // expected non-macro attribute, found attribute macro `derive` not a non-macro attribute
pub(crate) enum ItemType {
Regular,
Starter,
Glyph,
}
),
Relic,
Consumable
},
pub(crate) name: Box<str>,
}
}
But, if I change it to this, it does work (which, as far as I can tell, should be the same thing):
nest! {
#[derive(Debug, Clone)]*
pub(crate) struct Item {
pub(crate) id: u16,
pub(crate) category:
#[derive(Copy, PartialEq, Eq)]*
pub(crate) enum ItemCategory {
ItemType(ItemType),
Relic,
Consumable
},
pub(crate) name: Box<str>,
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
pub(crate) enum ItemType {
Regular,
Starter,
Glyph,
}
This would work theoretically, but I have a custom deserialization already defined for ItemCategory, so it won't work for my use-case:
nest! {
#[derive(Debug, Clone)]*
pub(crate) struct Item {
pub(crate) id: u16,
pub(crate) category:
#[derive(Copy, PartialEq, Eq, Deserialize)]*
pub(crate) enum ItemCategory {
Item(
pub(crate) enum ItemType {
Regular,
Starter,
Glyph,
}
),
Relic,
Consumable
},
pub(crate) name: Box<str>,
}
}
I'm not sure if this is a bug or intended behavior, but it would be really great if it was possible to still use #[derive(Deserialize)] on an Enum inside of an Enum.
Firstly, thank you for your work on this crate! It's very helpful & useful. 😃
Currently, the following will not compile with Nestify:
But, if I change it to this, it does work (which, as far as I can tell, should be the same thing):
This would work theoretically, but I have a custom deserialization already defined for
ItemCategory, so it won't work for my use-case:I'm not sure if this is a bug or intended behavior, but it would be really great if it was possible to still use
#[derive(Deserialize)]on an Enum inside of an Enum.