wiggle: GuestPtr<[u8]> => GuestPtr<str> conversions
This commit is contained in:
@@ -533,6 +533,14 @@ impl<'a> GuestPtr<'a, str> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> GuestPtr<'a, [u8]> {
|
||||
/// Returns a raw pointer to the string represented by a `[u8]` without
|
||||
/// validating whether each u8 is a utf-8 codepoint.
|
||||
pub fn as_str_ptr(&self) -> GuestPtr<str> {
|
||||
GuestPtr::new(self.mem, self.pointer)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: ?Sized + Pointee> Clone for GuestPtr<'_, T> {
|
||||
fn clone(&self) -> Self {
|
||||
*self
|
||||
|
||||
Reference in New Issue
Block a user