diff --git a/CHANGELOG.md b/CHANGELOG.md index 40a646a..b3cc4a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ Recent Changes (arrayvec) ========================= +## Unreleased +- Add `as_ptr` and `as_mut_ptr` to `ArrayString` by @YuhanLiin + ## 0.7.4 - Add feature zeroize to support the `Zeroize` trait by @elichai diff --git a/src/array_string.rs b/src/array_string.rs index 90cfc09..a57345b 100644 --- a/src/array_string.rs +++ b/src/array_string.rs @@ -414,11 +414,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 } }