Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add no_default_substitutions to the macro/CLI tool #927

Closed
jsdw opened this issue Apr 24, 2023 · 0 comments · Fixed by #936
Closed

Add no_default_substitutions to the macro/CLI tool #927

jsdw opened this issue Apr 24, 2023 · 0 comments · Fixed by #936
Assignees

Comments

@jsdw
Copy link
Collaborator

jsdw commented Apr 24, 2023

We have no_default_derives now to disable the default derives/attrs. Perhaps we should add no_default_substitutions, which is more widely useful (ie usable with code generated to work with Subxt) and would allow users complete control over exactly which generated types are substituted and which are not?

Cons:

  1. This will have some caveats like no_default_derives does (eg certain defaults are added to work around things like eg BTreeMap imposing Ord constraints on generated types), and I wouldn't expect most users to want it, but it would be consistent with allowing people to opt out of default derives and users could conditionally derive what was needed and override things as they wish to work around issues themselves.
  2. I'm wary of supporting more use cases that don't revolve around using the macro to generate code for the Subxt library; I don't want us to end up with a bunch of complexity in the code to support more exotic uses that may be better off utilising their own codegen, since our macro stuff is geared towards generating a Subxt interface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants