PatchBukkit/rust/src/java/native_callbacks/utils.rs
2026-02-03 21:00:51 +01:00

7 lines
169 B
Rust

use std::ffi::{CStr, c_char};
#[must_use]
pub fn get_string(str_ptr: *const c_char) -> String {
unsafe { CStr::from_ptr(str_ptr).to_string_lossy().into_owned() }
}