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

codegen: Recursive derives for types #1268

Closed
lexnv opened this issue Nov 16, 2023 · 0 comments · Fixed by #1260
Closed

codegen: Recursive derives for types #1268

lexnv opened this issue Nov 16, 2023 · 0 comments · Fixed by #1260
Assignees

Comments

@lexnv
Copy link
Collaborator

lexnv commented Nov 16, 2023

Extend the derive_for_type to recursively add the derives on all inner fields.

For example, to derive Clone on MultiLocation one would need to do the following:

derive_for_type(path = "xcm::v2::multilocation::MultiLocation", derive = "Clone"),
derive_for_type(path = "xcm::v2::multilocation::Junctions", derive = "Clone"),
derive_for_type(path = "xcm::v2::junction::Junction", derive = "Clone"),
derive_for_type(path = "xcm::v2::NetworkId", derive = "Clone"),
derive_for_type(path = "xcm::v2::BodyId", derive = "Clone"),
derive_for_type(path = "xcm::v2::BodyPart", derive = "Clone"),
derive_for_type(
    path = "bounded_collections::weak_bounded_vec::WeakBoundedVec",
    derive = "Clone"
)

Ideally, developers could type just:
derive_for_type(path = "xcm::v2::multilocation::MultiLocation", derive = "Clone", recursive),

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