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

Improve unsafe comments/documentation/encapsulation #109

Open
itsjunetime opened this issue Feb 10, 2025 · 0 comments
Open

Improve unsafe comments/documentation/encapsulation #109

itsjunetime opened this issue Feb 10, 2025 · 0 comments

Comments

@itsjunetime
Copy link
Collaborator

As I've been poking through the code of this library recently, I've noticed that there are a lot of undocumented unsafe fns and blocks. I'd like to go through and improve documentation and encapsulation for a lot of these areas, if that's alright.

The specific steps that I feel could help with this a lot:

  • Apply the unsafe_op_in_unsafe_fn, clippy::multiple_unsafe_ops_per_block, and clippy::undocumented_unsafe_blocks lints in the Cargo.toml (and fix what they warn)
  • Replace a lot of the inner: *mut _ fields with inner: NonNull<_> instead to ensure the inner ptrs aren't null when we dereference them
  • Add utility fns that utilize NonNull::as_ref to get valid references to inner (for a lot of these wrapping structs) to avoid needing an unsafe block per-function

Do these all sound like reasonable steps? Would you accept PRs that take these steps?

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

1 participant