From 2e397413a1a5fff5eb3660c9a09f9e91cf480814 Mon Sep 17 00:00:00 2001 From: Levi Morrison Date: Wed, 30 Mar 2022 09:15:09 -0600 Subject: [PATCH] Add #[must_use] to some FFI functions --- ddprof-ffi/src/exporter.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ddprof-ffi/src/exporter.rs b/ddprof-ffi/src/exporter.rs index e4ec85f..634666a 100644 --- a/ddprof-ffi/src/exporter.rs +++ b/ddprof-ffi/src/exporter.rs @@ -155,6 +155,7 @@ fn try_to_endpoint( } } +#[must_use] #[export_name = "ddprof_ffi_ProfileExporterV3_new"] pub extern "C" fn profile_exporter_new( family: CharSlice, @@ -231,6 +232,7 @@ pub unsafe extern "C" fn profile_exporter_build( /// # Safety /// If the `exporter` and `request` are non-null, then they need to have been /// created by apis in this module. +#[must_use] #[export_name = "ddprof_ffi_ProfileExporterV3_send"] pub unsafe extern "C" fn profile_exporter_send( exporter: Option>, @@ -267,6 +269,7 @@ pub unsafe extern "C" fn send_result_drop(result: SendResult) { std::mem::drop(result) } +#[must_use] #[export_name = "ddprof_ffi_Vec_tag_new"] pub extern "C" fn vec_tag_new<'a>() -> crate::Vec> { crate::Vec::default() @@ -367,6 +370,7 @@ pub extern "C" fn vec_tag_result_drop(result: VecTagResult) { std::mem::drop(result) } +#[must_use] #[export_name = "ddprof_ffi_Vec_tag_parse"] pub extern "C" fn vec_tag_parse(string: CharSlice) -> VecTagResult { match string.try_into() {