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

Bubble unsafe up from Pixels::from_raw_pointer() #128

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

y-guyon
Copy link
Collaborator

@y-guyon y-guyon commented Apr 11, 2024

Also tag Decoder::set_io_raw() as unsafe.

Add fn safety section to comply with
https://rust-lang.github.io/rust-clippy/master/index.html#/missing_safety_doc

@y-guyon y-guyon force-pushed the pixels_unsafe_set_ptr branch from 203422d to 40a73c3 Compare April 11, 2024 15:01
@y-guyon y-guyon force-pushed the pixels_unsafe_set_ptr branch from 40a73c3 to ee18144 Compare April 11, 2024 15:03
self.io = Some(Box::new(DecoderRawIO::create(data, size)));
/// # Safety
///
/// This has an unsafe block and is intended for use only from the C API.
Copy link

Choose a reason for hiding this comment

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

Suggested change
/// This has an unsafe block and is intended for use only from the C API.
/// This function should be called from the C API entrypoints. The function never fails.
///
/// # Safety
///
/// The memory at `data` must be valid for `size` bytes.

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.

2 participants