e.g.
let mut name: Vec<u8> = Vec::with_capacity(size);
tox_try!(err, ll::tox_conference_peer_get_name(
self.raw,
conference_number,
peer_number,
name.as_mut_ptr(),
err.as_mut_ptr()
));
Ok(String::from_utf8_unchecked(name))
The resulting string is always empty. I've confirmed that the toxcore functions succeed, but for whatever reason the result never gets copied to the vector.
let mut name = MaybeUninit::<[u8; MAX_NAME_LENGTH]>::uninit();
tox_try!(err, ll::tox_conference_peer_get_name(
self.raw,
conference_number,
peer_number,
name.as_mut_ptr() as *mut u8,
err.as_mut_ptr()
));
Ok(String::from_utf8_lossy(&mut name.assume_init()[..size].to_string()))
However, this looks ugly to me. I'm not sure if it's safe or the proper solution.