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
The v2 macros generate code that directly uses the crate serde_json. The problem is that the user code might not have this crate as a dependency.
So, they might get confusing errors (about a missing serde_json crate when there is no instance of serde_json string in their project), and in order for the generated code to compile, they have to add it as a dependency which may be picked up as "unused" by linting tools.
From what I gathered writing some proc-macro crates, the good practice is to depend yourself on the crate, re-export the symbols you need and reference it from your own namespace.
The text was updated successfully, but these errors were encountered:
Sufflope
added a commit
to Sufflope/paperclip
that referenced
this issue
Sep 18, 2024
The
v2
macros generate code that directly uses the crateserde_json
. The problem is that the user code might not have this crate as a dependency.So, they might get confusing errors (about a missing
serde_json
crate when there is no instance ofserde_json
string in their project), and in order for the generated code to compile, they have to add it as a dependency which may be picked up as "unused" by linting tools.From what I gathered writing some proc-macro crates, the good practice is to depend yourself on the crate, re-export the symbols you need and reference it from your own namespace.
The text was updated successfully, but these errors were encountered: