From 63909a0744a93537e9b58390d6c30f86aebd43d9 Mon Sep 17 00:00:00 2001 From: Enok <416828041@qq.com> Date: Tue, 19 Jan 2021 22:39:30 +0800 Subject: [PATCH] fix lint --- test_ffi/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test_ffi/src/lib.rs b/test_ffi/src/lib.rs index cdcb6456d5cd9a..ce1a40a8f8c8c9 100644 --- a/test_ffi/src/lib.rs +++ b/test_ffi/src/lib.rs @@ -57,8 +57,8 @@ pub fn add_one_f64(arg: f64) -> f64 { } #[no_mangle] -pub extern "C" fn concat_string(str: *const c_char) -> *const c_char { - let str = unsafe { CStr::from_ptr(str) }; +pub unsafe extern "C" fn concat_string(str: *const c_char) -> *const c_char { + let str = CStr::from_ptr(str); let mut hello = String::from("hello "); hello.push_str(str.to_str().unwrap()); let str = CString::new(hello).unwrap();