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

Eliminate unsafe code from both ser and de of u8 #26

Merged
merged 1 commit into from
Mar 20, 2021

Conversation

dtolnay
Copy link
Contributor

@dtolnay dtolnay commented Mar 19, 2021

Fixes #17. Fixes #18. Closes #24.

It was a red flag to me that all the unsafe code in this crate was unsound. This PR reimplements the same optimized behavior for slices/arrays/vectors without needing any unsafe code.

The approach from #25 of hiding the trait method from docs but leaving it unsound (safe to call and safe to implement) does not seem like a satisfying fix to me.

Note that I have not touched one remaining unsafe code, which is still unsound (#19).

Copy link
Contributor

@evgenykuzyakov evgenykuzyakov left a comment

Choose a reason for hiding this comment

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

Thanks, this is indeed a better option.

@frol frol merged commit 3223286 into near:master Mar 20, 2021
@frol
Copy link
Collaborator

frol commented Mar 20, 2021

@dtolnay Thank you for the fix! 💫

@dtolnay dtolnay deleted the safe branch March 20, 2021 07:42
This was referenced May 31, 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
3 participants