summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Figuière <hub@figuiere.net>2023-12-31 17:57:22 -0500
committerHubert Figuière <hub@figuiere.net>2023-12-31 20:37:30 -0500
commitf7701707e22ace1901f41e2fcc848d9681d8c100 (patch)
treec8393dba308d1a7c43fa6111e872fd04ac815d8d
parente601eb27cb328d0e4b8e8a5f9ffb9f0861e1303d (diff)
capi: Fix some Rust warnings
- Use drop() explicitely Signed-off-by: Hubert Figuière <hub@figuiere.net>
-rw-r--r--src/capi/bitmap.rs2
-rw-r--r--src/capi/metavalue.rs2
-rw-r--r--src/capi/rawdata.rs2
-rw-r--r--src/capi/rawfile.rs2
-rw-r--r--src/capi/thumbnail.rs2
5 files changed, 5 insertions, 5 deletions
diff --git a/src/capi/bitmap.rs b/src/capi/bitmap.rs
index 04986a3..784c179 100644
--- a/src/capi/bitmap.rs
+++ b/src/capi/bitmap.rs
@@ -37,7 +37,7 @@ pub type ORBitmapDataRef = *mut RawImage;
/// and will cause undefined behaviour.
extern "C" fn or_bitmapdata_release(bitmap: ORBitmapDataRef) -> or_error {
if !bitmap.is_null() {
- unsafe { Box::from_raw(bitmap) };
+ unsafe { drop(Box::from_raw(bitmap)) };
return or_error::NONE;
}
or_error::NOT_AREF
diff --git a/src/capi/metavalue.rs b/src/capi/metavalue.rs
index cba3315..79c2428 100644
--- a/src/capi/metavalue.rs
+++ b/src/capi/metavalue.rs
@@ -56,7 +56,7 @@ pub type ORMetaValueRef = *mut ORMetaValue;
/// Release a metavalue.
extern "C" fn or_metavalue_release(metavalue: ORMetaValueRef) {
if !metavalue.is_null() {
- unsafe { Box::from_raw(metavalue) };
+ unsafe { drop(Box::from_raw(metavalue)) };
}
}
diff --git a/src/capi/rawdata.rs b/src/capi/rawdata.rs
index 59cacf9..999b580 100644
--- a/src/capi/rawdata.rs
+++ b/src/capi/rawdata.rs
@@ -104,7 +104,7 @@ extern "C" fn or_rawdata_new() -> ORRawDataRef {
/// and will cause undefined behaviour.
extern "C" fn or_rawdata_release(rawdata: ORRawDataRef) -> or_error {
if !rawdata.is_null() {
- unsafe { Box::from_raw(rawdata) };
+ unsafe { drop(Box::from_raw(rawdata)) };
return or_error::NONE;
}
or_error::NOT_AREF
diff --git a/src/capi/rawfile.rs b/src/capi/rawfile.rs
index dbbc4a1..b00dad0 100644
--- a/src/capi/rawfile.rs
+++ b/src/capi/rawfile.rs
@@ -104,7 +104,7 @@ extern "C" fn or_rawfile_new_from_memory(buffer: *const u8, len: u32, type_: Typ
/// and will cause undefined behaviour.
extern "C" fn or_rawfile_release(rawfile: ORRawFileRef) -> or_error {
if !rawfile.is_null() {
- unsafe { Box::from_raw(rawfile) };
+ unsafe { drop(Box::from_raw(rawfile)) };
return or_error::NONE;
}
or_error::NOT_AREF
diff --git a/src/capi/thumbnail.rs b/src/capi/thumbnail.rs
index 940aacb..798422f 100644
--- a/src/capi/thumbnail.rs
+++ b/src/capi/thumbnail.rs
@@ -46,7 +46,7 @@ extern "C" fn or_thumbnail_new() -> ORThumbnailRef {
/// and will cause undefined behaviour.
extern "C" fn or_thumbnail_release(thumbnail: ORThumbnailRef) -> or_error {
if !thumbnail.is_null() {
- unsafe { Box::from_raw(thumbnail) };
+ unsafe { drop(Box::from_raw(thumbnail)) };
return or_error::NONE;
}
or_error::NOT_AREF