Skip to content

Commit 6c3796d

Browse files
committed
#138: Mark the to_rust_string function as unsafe
1 parent 5a0400b commit 6c3796d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rust/src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ use crate::api::{
2626
};
2727
use crate::{cache, errors, InvocationArg, JavaClass};
2828

29-
pub fn to_rust_string(pointer: *const c_char) -> errors::Result<String> {
30-
let slice = unsafe { CStr::from_ptr(pointer).to_bytes() };
29+
pub unsafe fn to_rust_string(pointer: *const c_char) -> errors::Result<String> {
30+
let slice = CStr::from_ptr(pointer).to_bytes();
3131
Ok(from_java_cesu8(slice)?.to_string())
3232
}
3333

0 commit comments

Comments
 (0)