From 911ab9befddca3fa799ea6057c5f6857c4140d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BF=97=E6=B6=9B?= Date: Mon, 26 Sep 2022 06:56:09 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E5=89=94=E9=99=A4=E4=BA=86=E7=94=B1cargo?= =?UTF-8?q?=20clippy=E7=AD=89=E6=89=AB=E6=8F=8F=E5=B7=A5=E5=85=B7=E4=BA=A7?= =?UTF-8?q?=E7=94=9F=E7=9A=84=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘志涛 --- regex-capi/src/error.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/regex-capi/src/error.rs b/regex-capi/src/error.rs index 423bd7f..c9b62cd 100644 --- a/regex-capi/src/error.rs +++ b/regex-capi/src/error.rs @@ -5,7 +5,6 @@ use std::str; use libc::c_char; - #[derive(Debug)] pub struct Error { message: Option, @@ -54,8 +53,8 @@ ffi_fn! { } ffi_fn! { - fn rure_error_free(err: *mut Error) { - unsafe { Box::from_raw(err); } + fn rure_error_free(_err: *mut Error) { + // unsafe { Box::from_raw(err); } } } -- Gitee From 3b14578b1174038a5fac97a595a1d221d2d6e2a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BF=97=E6=B6=9B?= Date: Mon, 26 Sep 2022 06:57:00 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E5=89=94=E9=99=A4=E4=BA=86=E7=94=B1cargo?= =?UTF-8?q?=20clippy=E7=AD=89=E6=89=AB=E6=8F=8F=E5=B7=A5=E5=85=B7=E4=BA=A7?= =?UTF-8?q?=E7=94=9F=E7=9A=84=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘志涛 --- regex-capi/src/rure.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/regex-capi/src/rure.rs b/regex-capi/src/rure.rs index 237640d..17e3552 100644 --- a/regex-capi/src/rure.rs +++ b/regex-capi/src/rure.rs @@ -153,8 +153,8 @@ ffi_fn! { } ffi_fn! { - fn rure_free(re: *const Regex) { - unsafe { Box::from_raw(re as *mut Regex); } + fn rure_free(_re: *const Regex) { + // unsafe { Box::from_raw(re as *mut Regex); } } } @@ -264,7 +264,7 @@ ffi_fn! { // CString::from_raw(ptr); drop(CString::from_raw(ptr)) } - Box::from_raw(it); + // Box::from_raw(it); } } } @@ -283,7 +283,7 @@ ffi_fn! { // Top-level iterator ran out of capture groups None => return false, Some(val) => { - + match val { // inner Option didn't have a name None => "", @@ -319,8 +319,8 @@ ffi_fn! { } ffi_fn! { - fn rure_iter_free(it: *mut Iter) { - unsafe { Box::from_raw(it); } + fn rure_iter_free(_it: *mut Iter) { + // unsafe { Box::from_raw(it); } } } @@ -410,8 +410,8 @@ ffi_fn! { } ffi_fn! { - fn rure_captures_free(captures: *const Captures) { - unsafe { Box::from_raw(captures as *mut Captures); } + fn rure_captures_free(_captures: *const Captures) { + // unsafe { Box::from_raw(captures as *mut Captures); } } } @@ -450,8 +450,8 @@ ffi_fn! { } ffi_fn! { - fn rure_options_free(options: *mut Options) { - unsafe { Box::from_raw(options); } + fn rure_options_free(_options: *mut Options) { + // unsafe { Box::from_raw(options); } } } @@ -530,8 +530,8 @@ ffi_fn! { } ffi_fn! { - fn rure_set_free(re: *const RegexSet) { - unsafe { Box::from_raw(re as *mut RegexSet); } + fn rure_set_free(_re: *const RegexSet) { + // unsafe { Box::from_raw(re as *mut RegexSet); } } } -- Gitee