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

Remove duplicate API on Types #1837

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

alexcrichton
Copy link
Member

This commit removes the duplicate API of Types and TypesRef in the wasmparser crate by removing the API on Types. The source of truth is the one on TypesRef and maintaining this duplication is a bit of a burden as it's a lot of copy/pasted code. It's hoped that users can instead use .as_ref() "early on" which will enable the same usage as before. Ideally this would be a Deref impl but due to how Deref works that's not possible right now.

This commit removes the duplicate API of `Types` and `TypesRef` in the
`wasmparser` crate by removing the API on `Types`. The source of truth
is the one on `TypesRef` and maintaining this duplication is a bit of a
burden as it's a lot of copy/pasted code. It's hoped that users can
instead use `.as_ref()` "early on" which will enable the same usage as
before. Ideally this would be a `Deref` impl but due to how `Deref`
works that's not possible right now.
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

Good clean up

@fitzgen fitzgen added this pull request to the merge queue Oct 2, 2024
Merged via the queue into bytecodealliance:main with commit d4532cb Oct 2, 2024
30 checks passed
@alexcrichton alexcrichton deleted the less-duplication branch October 2, 2024 16:43
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.

2 participants