From 19b05d8f17d0f0b416dcac107c24f5d312ed7a02 Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 14 Jul 2022 14:57:39 +0900 Subject: [PATCH] capi: fix 'unused return value' warnings from `cargo check` --- regex-capi/src/rure.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/regex-capi/src/rure.rs b/regex-capi/src/rure.rs index dc49b20a3..ec79fe410 100644 --- a/regex-capi/src/rure.rs +++ b/regex-capi/src/rure.rs @@ -257,8 +257,8 @@ ffi_fn! { fn rure_iter_capture_names_free(it: *mut IterCaptureNames) { unsafe { let it = &mut *it; - while let Some(ptr) = it.name_ptrs.pop(){ - CString::from_raw(ptr); + while let Some(ptr) = it.name_ptrs.pop() { + drop(CString::from_raw(ptr)); } Box::from_raw(it); } @@ -624,6 +624,6 @@ fn rure_escape( ffi_fn! { fn rure_cstring_free(s: *mut c_char) { - unsafe { CString::from_raw(s); } + unsafe { drop(CString::from_raw(s)); } } }