Skip to content

Commit 53e1d34

Browse files
committed
Clippy
1 parent 2e810a3 commit 53e1d34

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

imagequant-sys/src/ffi.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ pub use imagequant::Error as liq_error;
2222
pub struct liq_attr {
2323
magic_header: MagicTag,
2424
inner: Attributes,
25-
c_api_free: unsafe extern fn(*mut c_void),
25+
c_api_free: unsafe extern "C" fn(*mut c_void),
2626
}
2727

2828
#[repr(C)]
2929
pub struct liq_image<'pixels> {
3030
magic_header: MagicTag,
3131
inner: ManuallyDrop<Image<'pixels>>,
32-
c_api_free: unsafe extern fn(*mut c_void),
32+
c_api_free: unsafe extern "C" fn(*mut c_void),
3333
}
3434

3535
#[repr(C)]
@@ -424,7 +424,7 @@ pub extern "C" fn liq_histogram_destroy(_hist: Option<Box<liq_histogram>>) {}
424424
#[no_mangle]
425425
#[inline(never)]
426426
#[deprecated(note = "custom allocators are no longer supported")]
427-
pub extern "C" fn liq_attr_create_with_allocator(_unused: *mut c_void, free: unsafe extern fn(*mut c_void)) -> Option<Box<liq_attr>> {
427+
pub extern "C" fn liq_attr_create_with_allocator(_unused: *mut c_void, free: unsafe extern "C" fn(*mut c_void)) -> Option<Box<liq_attr>> {
428428
let attr = Box::new(liq_attr {
429429
magic_header: LIQ_ATTR_MAGIC,
430430
inner: Attributes::new(),

src/capi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ pub unsafe fn liq_write_remapped_image_rows_impl(result: &mut QuantizationResult
5656
}
5757

5858
/// Not recommended
59-
pub unsafe fn liq_image_set_memory_ownership_impl(image: &mut Image<'_>, own_rows: bool, own_pixels: bool, free_fn: unsafe extern fn(*mut std::os::raw::c_void)) -> Result<(), Error> {
59+
pub unsafe fn liq_image_set_memory_ownership_impl(image: &mut Image<'_>, own_rows: bool, own_pixels: bool, free_fn: unsafe extern "C" fn(*mut std::os::raw::c_void)) -> Result<(), Error> {
6060
image.px.set_memory_ownership(own_rows, own_pixels, free_fn)
6161
}

src/rows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl<'pixels, 'rows> DynamicRows<'pixels, 'rows> {
216216

217217
/// Not recommended
218218
#[cfg(feature = "_internal_c_ffi")]
219-
pub(crate) unsafe fn set_memory_ownership(&mut self, own_rows: bool, own_pixels: bool, free_fn: unsafe extern fn(*mut std::os::raw::c_void)) -> Result<(), Error> {
219+
pub(crate) unsafe fn set_memory_ownership(&mut self, own_rows: bool, own_pixels: bool, free_fn: unsafe extern "C" fn(*mut std::os::raw::c_void)) -> Result<(), Error> {
220220
if own_rows {
221221
match &mut self.pixels {
222222
PixelsSource::Pixels { rows, .. } => rows.make_owned(free_fn),

src/seacow.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<'a, T> SeaCow<'a, T> {
4444
#[inline]
4545
#[cfg(feature = "_internal_c_ffi")]
4646
#[must_use]
47-
pub unsafe fn c_owned(ptr: *mut T, len: usize, free_fn: unsafe extern fn(*mut c_void)) -> Self {
47+
pub unsafe fn c_owned(ptr: *mut T, len: usize, free_fn: unsafe extern "C" fn(*mut c_void)) -> Self {
4848
debug_assert!(!ptr.is_null());
4949
debug_assert!(len > 0);
5050

@@ -55,7 +55,7 @@ impl<'a, T> SeaCow<'a, T> {
5555

5656
#[inline]
5757
#[cfg(feature = "_internal_c_ffi")]
58-
pub(crate) fn make_owned(&mut self, free_fn: unsafe extern fn(*mut c_void)) {
58+
pub(crate) fn make_owned(&mut self, free_fn: unsafe extern "C" fn(*mut c_void)) {
5959
if let SeaCowInner::Borrowed(slice) = self.inner {
6060
self.inner = SeaCowInner::Owned { ptr: slice.as_ptr().cast_mut(), len: slice.len(), free_fn };
6161
}
@@ -80,7 +80,7 @@ impl<T: Clone> Clone for SeaCowInner<'_, T> {
8080

8181
enum SeaCowInner<'a, T> {
8282
#[cfg(feature = "_internal_c_ffi")]
83-
Owned { ptr: *mut T, len: usize, free_fn: unsafe extern fn(*mut c_void) },
83+
Owned { ptr: *mut T, len: usize, free_fn: unsafe extern "C" fn(*mut c_void) },
8484
Borrowed(&'a [T]),
8585
Boxed(Box<[T]>),
8686
}

0 commit comments

Comments
 (0)