(raw: *mut c_char)
| 249 | } |
| 250 | |
| 251 | fn take_native_string(raw: *mut c_char) -> String { |
| 252 | let value = unsafe { CStr::from_ptr(raw).to_string_lossy().into_owned() }; |
| 253 | unsafe { ffi::xcw_native_free_string(raw) }; |
| 254 | value |
| 255 | } |
| 256 | |
| 257 | fn cstring(name: &str, value: &str) -> Result<CString, AppError> { |
| 258 | CString::new(value).map_err(|_| AppError::bad_request(format!("{name} contains NUL byte."))) |
no test coverage detected