Skip to content

Commit f955176

Browse files
authored
refactor: move wrap into separate attribute, cleanup derive macro code (#55)
This has a couple of refactorings on top of #51: * Move the `wrap` functionality into a `wrap` attribute on variants, and adjust docs accordingly. I think this is better, it is a separate feature from the rpc types, and the rpc attr easily gets too long for a single line otherwise. * Add support to set visibility and additional derives for `wrap` types. This makes this far more useful, otherwise you can't use the wrap argument as soon as you need a derive (e.g. Clone) on the generated type. By refactoring the code a bit, this barely adds more code to the macro. * Make `tx` argument in `rpc` attribute optional, and change parsing to not use a map but just look for the only two arguments (`rx` and `tx`) * Refactor the derive crate to be a bit simpler, and easier to follow by putting the main macro up to the top of the file * Adds a full example to crate docs The refactor of the `derive` crate has no changes apart from the `wrap` changes outlined above.
1 parent 9ee8f35 commit f955176

File tree

5 files changed

+433
-374
lines changed

5 files changed

+433
-374
lines changed

0 commit comments

Comments
 (0)