Skip to content

feat(sol-macro-expander): add Clone trait to enum contracts containers - #1003

Merged
DaniPopes merged 1 commit into
alloy-rs:mainfrom
fd0r:fd0r/add-clone-trait-to-sol-macro-expander-derives
Sep 2, 2025
Merged

DaniPopes merged 1 commit into
alloy-rs:mainfrom
fd0r:fd0r/add-clone-trait-to-sol-macro-expander-derives

Conversation

@fd0r

@fd0r fd0r commented Sep 2, 2025

Copy link
Copy Markdown
Contributor

Motivation

The enum containers associated to contracts function calls, custom errors and events, don't implement the Clone trait while the underlying structs do.
Having the Clone trait propagated at this higher level is generally useful.

Solution

Add #[derive(Clone)] where the containers are defined.

PR Checklist

  • Added Tests
    • No pre-existing test on which traits are implemented.
  • Added Documentation
    • No pre-existing documentation on which traits are implemented in the custom containers.
  • Breaking changes
    • Not a breaking change

@DaniPopes DaniPopes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@github-project-automation github-project-automation Bot moved this to Reviewed in Alloy Sep 2, 2025

@mattsse mattsse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should always work because we do the same for the variants

@DaniPopes
DaniPopes merged commit 9ecb8cf into alloy-rs:main Sep 2, 2025
@github-project-automation github-project-automation Bot moved this from Reviewed to Done in Alloy Sep 2, 2025
@fd0r
fd0r deleted the fd0r/add-clone-trait-to-sol-macro-expander-derives branch September 2, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants