INNER CODE UNIT · Rust
free_c_str
elringus/sprite-dicing · crates/abi/src/lib.rs:251
unsafe fn free_c_str(ptr: *const c_char) {
if !ptr.is_null() {
drop(CString::from_raw(ptr as *mut c_char));
}
}
#[cfg(test)]
mod tests {
use super::*;
use std::ffi::c_void;
const RED: sd_pixel = sd_pixel {
r: 255,
g: 0,
b: 0,
a: 255,
};
const BLUE: sd_pixel = sd_pixel {