Skip to content

Commit

Permalink
Merge pull request #189 from clarfonthey/as_mut_str
Browse files Browse the repository at this point in the history
Add ArrayString::as_mut_str
  • Loading branch information
bluss authored Jun 20, 2021
2 parents 0c866b3 + c491781 commit e5b3c9b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/array_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ impl<const CAP: usize> ArrayString<CAP>
self
}

/// Return a mutable string slice of the whole `ArrayString`.
pub fn as_mut_str(&mut self) -> &mut str {
self
}

fn as_ptr(&self) -> *const u8 {
self.xs.as_ptr() as *const u8
}
Expand Down

0 comments on commit e5b3c9b

Please sign in to comment.