virtue
virtue copied to clipboard
A sinless derive helper
My use case is the following: I would like to derive a macro for my enum and then for each struct-field variant generate an identical struct which the same attributes...
Thanks for virtue, it works nicely for my purposes parsing SSH binary protocol. I'm using enum variant attributes that can have `Ident`s in them such as `#[sshwire(variant = SSH_NAME_ED25519)]`, where...
it would be nice to be able to generate compile-time checks. These are usually in the form of: ```rs const _: () = { if !some_check() { panic!(""); }}; ```...
When implementing generics, I found an oversight in enum generation: ```rust generator .generate_enum("Foo") .add_value("Bar") .add_pub_field("bar", "u32"); // Generates: enum Foo { Bar { pub bar: u32 } } ``` This...
https://github.com/bincode-org/virtue/blob/1ecc01325a038c4f28aa8de25caae7c6eb91c66f/src/parse/body.rs#L210-L239 if a derive macro using virtue is applied to code generated by a macro_rules! macro, token trees are wrapped in an empty delimiter and this code fails: ```rust macro_rules!...
I ran into this while using the bincode derive macros. There were two bugs: - Defaults used in combination with constraints would get parsed as part of the constraints because...