(raw: *mut i8, error: *mut i8)
| 1343 | } |
| 1344 | |
| 1345 | unsafe fn string_from_raw(raw: *mut i8, error: *mut i8) -> Result<String, AppError> { |
| 1346 | if raw.is_null() { |
| 1347 | return Err(take_error(error).unwrap_or_else(|| AppError::native("Unknown native error."))); |
| 1348 | } |
| 1349 | let value = CStr::from_ptr(raw).to_string_lossy().into_owned(); |
| 1350 | ffi::xcw_native_free_string(raw); |
| 1351 | Ok(value) |
| 1352 | } |
| 1353 | |
| 1354 | unsafe fn bool_result(result: bool, error: *mut i8) -> Result<(), AppError> { |
| 1355 | if result { |
no test coverage detected