Skip to content

chore: preserve original resolve when decoding WIT package twice #2125

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

0xsenty
Copy link

@0xsenty 0xsenty commented Apr 4, 2025

The second call to wit_component::decode reused the resolve identifier from the first decode. This silently overwrites the original resolve, which can be misleading — especially since both resolve and resolve2 are referenced later in the function.

I’ve updated the second match arm to bind to resolve2 instead, so both decoded values are preserved independently as originally intended.

This should clarify the logic and avoid unintentional data loss.

@alexcrichton
Copy link
Member

Thanks! Is this perhaps the wrong change though? This current PR looks like it's a small refactoring but no actual behavior changes.

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