Skip to content

Commit

Permalink
ndk/bitmap: Add missing # Safety docs to satisfy Rust 1.74 lint
Browse files Browse the repository at this point in the history
`clippy::missing_safety_doc` is turned on by default but didn't catch
one `unsafe` function; that seems to have been fixed in Rust 1.74, for
which we should add the missing reason why `compress_raw()` is annotated
as `unsafe`.
  • Loading branch information
MarijnS95 committed Nov 20, 2023
1 parent 87acd19 commit 276f6a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ndk/src/bitmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ impl Bitmap {
/// current thread, each time the compressor has compressed more data that is ready to be
/// written. May be called more than once for each call to this method.
///
/// # Safety
/// `pixels` must point to a valid buffer that matches the size, stride and format in `info`.
///
/// [`compress()`]: Self::compress()
/// [^1]: <https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/apex/android_bitmap.cpp;l=275-279;drc=7ba5c2fb3d1e35eb37a9cc522b30ba51f49ea491>
#[cfg(feature = "api-level-30")]
Expand Down

0 comments on commit 276f6a5

Please sign in to comment.