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

Rust: Don't type alias strings #150

Merged
merged 11 commits into from
Feb 15, 2023
Merged

Rust: Don't type alias strings #150

merged 11 commits into from
Feb 15, 2023

Conversation

leighmcculloch
Copy link
Member

@leighmcculloch leighmcculloch commented Feb 14, 2023

What

Don't type alias strings in Rust generated code.

Also, preserve the alias' type's name rather than using the base type name in places.

Why

For StringM types we type alias. But for BytesM (variable length opaques) we don't. Type aliasing is convenient in some cases as it makes some code shorter, but it gives us less flexibility as we can't attach new functions to the types generated. For example we can't attach functions to ScSymbol because it is only a type alias of StringM.

@leighmcculloch leighmcculloch changed the title Rust: Type alias types wrapping opaque Rust: Don't type alias strings Feb 15, 2023
@graydon graydon self-requested a review February 15, 2023 00:43
@graydon graydon merged commit 6e42b01 into master Feb 15, 2023
@graydon graydon deleted the bytesmbuiltin branch February 15, 2023 00:44
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 this pull request may close these issues.

None yet

2 participants