Refactor zbus_macros and zvariant_derive to use common code.
I've noticed there are similarities between what zvariant_derive and zbus_macros crates do. In particular both crates:
- Parse structure/enum/field attributes. zvariant_derive was recently refactored to use cleaner code in !639 (merged), but zbus_macros has been left without any attention.
- Convert cases. Case conversion code for zvariant_derive was copied with little changes from zbus_macros.
I suggest adding a new crate that contains utilities used by both crates.
Benefits:
- Cleaner code that is easier to understand in both crates.
- Less code duplication and faster compile times.
- Easier changes to supported attributes in zbus_macros.
Drawbacks:
- A new dependency for these crates. This dependency is fully controlled though so I don't think this is an issue.
Questions:
- What will the name of the crate be?
- Are there any requirements on the architecture for such a crate?
I can submit a MR in case you like the idea.
Edited by Turbo Cooler