Closed unmaykr-aftermath closed 7 months ago
Hi there
Interesting issue.
If you wanna try you can do it; But I can do it myself if you wish, let me know if so.
I guess you'll need to update the struct and use it in the trait emit.
Take care
Hi there
Interesting issue.
If you wanna try you can do it; But I can do it myself if you wish, let me know if so.
I guess you'll need to update the struct and use it in the trait emit.
Take care
@zhiburt If you wanna have a stab at it first, I think I'll only have time next week for it. Thanks for the tip btw!
Problem
I've run into the following issue while developing a
macro_rules!
macro that auto-implementsTabled
for a struct:cargo clippy
output:This happens because there are lines like this in the
derive
implementation: https://github.com/zhiburt/tabled/blob/master/tabled_derive/src/lib.rs#L48Hence, crates that use my macro will be forced to import both my crate and the
tabled
crate, which is not great ergonomics.Request
Add a
#[tabled(crate = ...)]
that takes as argument the path of thetabled
crate. This will allow crates to re-exporttabled
and let users use their macros without explicitly importingtabled
.Basically the same as serde's
#[serde(crate = "...")]
attribute.I have some experience implementing macros like this and can do so for
tabled
if the community/maintainers agree with the addition.