Skip to content

Conversation

@febo
Copy link
Contributor

@febo febo commented Feb 8, 2025

Problem

As described in #207 , try_to_vec was removed from borsh in versions 1.x. This causes problems since the rust renderer generates code using it.

Solution

Replace the use of try_to_vec by borsh::to_vec, which is available in versions of borsh < 1.

Fixes #207

@changeset-bot
Copy link

changeset-bot bot commented Feb 8, 2025

🦋 Changeset detected

Latest commit: 82667fb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@codama/renderers-rust Patch
@codama/cli Patch
@codama/renderers Patch
codama Patch
@codama/errors Patch
@codama/node-types Patch
@codama/nodes Patch
@codama/validators Patch
@codama/visitors-core Patch
@codama/visitors Patch
@codama/dynamic-codecs Patch
@codama/dynamic-parsers Patch
@codama/nodes-from-anchor Patch
@codama/renderers-core Patch
@codama/renderers-js-umi Patch
@codama/renderers-js Patch
@codama/renderers-vixen-parser Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@febo febo requested a review from lorisleiva February 8, 2025 22:39
Copy link
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

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

Very nice! 🍺

@lorisleiva lorisleiva merged commit 4867be4 into main Feb 8, 2025
4 checks passed
@lorisleiva lorisleiva deleted the febo/to_vec branch February 8, 2025 23:16
@github-actions github-actions bot mentioned this pull request Feb 8, 2025
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.

Rust renderer generates invalid code for newer borsh versions

3 participants