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

[Feature] Avoid conflicting functions with common trait impls on UDT types #826

Open
Will-Smith11 opened this issue Dec 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Will-Smith11
Copy link
Contributor

Component

sol-types, sol! macro, syn-solidity

Describe the feature you would like

On UDT types, currently there is a impl that converts to and from the underlying.

                /// Convert from the underlying value type.
                #[inline]
                pub const fn from(value: #underlying_rust) -> Self {
                    Self(value)
                }

                /// Return the underlying value.
                #[inline]
                pub const fn into(self) -> #underlying_rust {
                    self.0
                }

However these functions conflict with regular into and from trait impl's. Currently this will just render them useless (the impl on the struct will always override the trait impls). I recommend changing the naming to, from_underlying and into_underlying

Additional context

No response

@Will-Smith11 Will-Smith11 added the enhancement New feature or request label Dec 13, 2024
@Will-Smith11
Copy link
Contributor Author

actually a even better solution would just be implimenting the from and into traits for this type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant