1 2 3 4 5 6
let {{ name }}_rs = if {{ name }}.is_null() { String::new() } else { // SAFETY: null check above guarantees {{ name }} is a valid pointer. unsafe { std::ffi::CStr::from_ptr({{ name }}) }.to_string_lossy().into_owned() };