From 9f45cc26c34ade6f8620309a771bb5f180c5845a Mon Sep 17 00:00:00 2001 From: YuhanLiin Date: Thu, 25 Jan 2024 23:50:20 -0500 Subject: [PATCH] Make as_ptr and as_mut_ptr on ArrayString public --- src/array_string.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/array_string.rs b/src/array_string.rs index 7f6e299..de4ac4c 100644 --- a/src/array_string.rs +++ b/src/array_string.rs @@ -415,11 +415,13 @@ impl ArrayString self } - fn as_ptr(&self) -> *const u8 { + /// Return a raw pointer to the string's buffer. + pub fn as_ptr(&self) -> *const u8 { self.xs.as_ptr() as *const u8 } - fn as_mut_ptr(&mut self) -> *mut u8 { + /// Return a raw mutable pointer to the string's buffer. + pub fn as_mut_ptr(&mut self) -> *mut u8 { self.xs.as_mut_ptr() as *mut u8 } }