Skip to content

Conversation

fd0r
Copy link
Contributor

@fd0r fd0r commented Sep 2, 2025

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

Copy link
Member

@DaniPopes DaniPopes left a comment

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
Copy link
Member

@mattsse mattsse left a comment

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
32 checks passed
@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