You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments