Skip to content

Commit

Permalink
Make as_ptr and as_mut_ptr on ArrayString public
Browse files Browse the repository at this point in the history
  • Loading branch information
YuhanLiin authored and bluss committed Mar 7, 2024
1 parent 1cd7b9d commit 9f45cc2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/array_string.rs
Expand Up @@ -415,11 +415,13 @@ impl<const CAP: usize> ArrayString<CAP>
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
}
}
Expand Down

0 comments on commit 9f45cc2

Please sign in to comment.