I implemented a #RustLang derive macro that generates code which uses functionality from the serde_derive crate. Drawback: the crate using this derive macro must have serde_derive imported toplevel, and it must not be aliased. How do I properly decouple from that? Is it possible to re-export the dependency in my derive-macro crate? How would I resolve my crate in an absolute manner? It appears $crate is not available in derive macros. #followerpower
⇧
Mo :ferris: :tux:
•Mo :ferris: :tux:
•silwol
•silwol
•Mo :ferris: :tux:
•silwol
•Sebastian Dröge 🍵
•proc-macro-crate
crate for this purpose. It's not perfect but catches the most common cases.silwol
•Lukas Atkinson
•#[derive(Serialize)]
#[serde(crate = "some_alias")]
struct Foo { ... }
https://serde.rs/container-attrs.html#crate
Container attributes · Serde
serde.rssilwol
•