Skip to content

Commit e5b3c9b

Browse files
authored
Merge pull request #189 from clarfonthey/as_mut_str
Add ArrayString::as_mut_str
2 parents 0c866b3 + c491781 commit e5b3c9b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/array_string.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,11 @@ impl<const CAP: usize> ArrayString<CAP>
370370
self
371371
}
372372

373+
/// Return a mutable string slice of the whole `ArrayString`.
374+
pub fn as_mut_str(&mut self) -> &mut str {
375+
self
376+
}
377+
373378
fn as_ptr(&self) -> *const u8 {
374379
self.xs.as_ptr() as *const u8
375380
}

0 commit comments

Comments
 (0)