refact: Add callback_get_vec_u8_data

Make it easier to correctly use the string callbacks.

(cherry picked from commit 32db5dfc020053c36b7a4776313ee72d7bc961dd)
This commit is contained in:
Robert Hensing 2024-04-08 16:25:37 +02:00
parent 7cc9cfbb2b
commit acb1274c08
2 changed files with 6 additions and 2 deletions

View file

@ -16,6 +16,10 @@ pub unsafe extern "C" fn callback_get_vec_u8(
(*ret).extend_from_slice(slice);
}
pub fn callback_get_vec_u8_data(vec: &mut Vec<u8>) -> *mut std::os::raw::c_void {
vec as *mut Vec<u8> as *mut std::os::raw::c_void
}
#[cfg(test)]
mod tests {
use super::*;