No empty struct
dtolnay opened this issue · comments
I would prefer not to generate struct $typename {}
. Some better options:
struct $typename;
-- more idiomatic for a struct with no contentenum $typename {}
-- cannot be instantiatedmod $modname { /* serialize, deserialize */ }
-- not a type
I think module is the best option just because there isn't a reason for a type to be involved. Like you would never want to pass this $typename as a generic type parameter somewhere or instantiate it.
I keep forgetting I can have no-curly structs in Rust...
It seems weird to me that there isn't a type for this, but maybe this part of serde will make more sense once I tackle #3.
Fixed in 337cf3e