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

get rid of unnecessary uses of unsafe #460

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Freax13
Copy link
Contributor

@Freax13 Freax13 commented Sep 19, 2024

This PR get's rid of some unnecessary uses of unsafe mainly by switching to safe alternatives provided by the zerocopy crate.

It turns out all of our uses of unsafe in this module can be trivally
replaced by uses of the zerocopy crate.

Signed-off-by: Tom Dohrmann <erbse.13@gmx.de>
Once again, zerocopy can do everything we needed without us using
unsafe.

Signed-off-by: Tom Dohrmann <erbse.13@gmx.de>
The new implementation is much shorter, should perform exactly the same
and doesn't even rely on unsafe.

Signed-off-by: Tom Dohrmann <erbse.13@gmx.de>
zerocopy is great :)

Signed-off-by: Tom Dohrmann <erbse.13@gmx.de>
We can make use of the `Deref` and `DerefMut` implementations.

Signed-off-by: Tom Dohrmann <erbse.13@gmx.de>
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.

1 participant