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

Tracking issue for replacing unsafe code. #87

Open
3 tasks
Frostie314159 opened this issue Nov 5, 2023 · 2 comments
Open
3 tasks

Tracking issue for replacing unsafe code. #87

Frostie314159 opened this issue Nov 5, 2023 · 2 comments

Comments

@Frostie314159
Copy link
Contributor

Frostie314159 commented Nov 5, 2023

In the interest of exploring pure safe alternatives to unsafe functions, this issue tracks all uses and potential replacements. The unsafe portions are usually quite similar, so only one entry will be made per function.

@Frostie314159
Copy link
Contributor Author

Regarding the CStr::from_bytes_with_nul_unchecked, there exists a safe alternative: CStr::from_bytes_until_nul, which basically replaces all checks, we do already. Full disclosure, this function eventually calls the unchecked version internally, but IMO it's better to let core handle as much unsafe as possible, to profit from future optimizations.

@m4b
Copy link
Owner

m4b commented Aug 26, 2024

sorry for late reply :) i agree with replacing CStr impl, if there is a safe, std alternative, that seems good to me. as for others, well, I would have to see proposals :)

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

No branches or pull requests

2 participants