Skip to content
Snippets Groups Projects
Commit f922e1d6 authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

fix: FfiSafe{Bytes, Str}::into_raw_parts tweaks

parent be94ca88
No related branches found
No related tags found
1 merge request!1308fix: RouteBuilder::register now only supports Fn, not FnMut
......@@ -28,8 +28,8 @@ impl FfiSafeBytes {
}
#[inline(always)]
pub unsafe fn into_raw_parts(mut self) -> (*mut u8, usize) {
(&mut *self.pointer.as_mut(), self.len)
pub fn into_raw_parts(self) -> (*mut u8, usize) {
(self.pointer.as_ptr(), self.len)
}
/// Converts `self` back to a borrowed string `&[u8]`.
......@@ -102,6 +102,11 @@ impl FfiSafeStr {
Self { pointer, len }
}
#[inline(always)]
pub fn into_raw_parts(self) -> (*mut u8, usize) {
(self.pointer.as_ptr(), self.len)
}
/// Converts `self` back to a borrowed string `&str`.
///
/// # Safety
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment