Update Rust code
Replace deprecated CString.unwrap() with as_ptr()