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

feat: add proper support for isize and usize #99

Merged
merged 2 commits into from
Aug 3, 2022

Conversation

itegulov
Copy link
Contributor

@itegulov itegulov commented Aug 3, 2022

Fixes #40 and #49

Technically, isize/usize have different deserialization semantics from i64/u64, but since isize/usize are not a part of the spec I guess we don't really have many options.

@matklad
Copy link
Contributor

matklad commented Aug 3, 2022

Makes sense to me: in general, it's not true that borsh types correspond to rust types (eg, collections are restricted to u32::MAX elements only), so this seems exactly like how it should be.

@itegulov
Copy link
Contributor Author

itegulov commented Aug 3, 2022

Also, just noticed that we have BorshSchema impl for char, but not BorshSerialize or BorshDeserialize. Furthermore, the spec does not mention char in any way, so it seems like the schema impl should be deleted?

@frol frol merged commit 608723b into master Aug 3, 2022
@frol
Copy link
Collaborator

frol commented Aug 3, 2022

This PR makes perfect sense to me. Thanks for aligning things!

@frol frol mentioned this pull request May 31, 2023
@frol frol deleted the daniyar/impl-isize-usize branch June 2, 2023 20:03
@frol frol mentioned this pull request Jun 6, 2023
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.

Add usize/isize to borsh schema impls
3 participants