This is kinda what prompted me to post View macro output live? - #2 by zeroexcuses but they are separate topics, so figured it's best to post this separately...
I'd like to write something like:
bridge_events![
InitialLoad,
ChangeTodo(EntityId, String),
]
which will turn into both of these:
#[cfg_attr(feature = "ts_test", derive(EnumIter, AsRefStr))]
#[derive(FromPrimitive, Copy, Clone, Debug)]
#[repr(u32)]
pub enum BridgeEvent {
InitialLoad,
ChangeTodo,
}
pub enum Event {
InitialLoad,
ChangeTodo(EntityId, String),
}
So it separates the enum variant name from the params to create the BridgeEvent
variants and then reconstructs it (or uses the original) to just write Event
variants directly.
I'd imagine the attributes above BridgeEvent
don't really matter - but figured I'd include it just in case that changes things...