Skip to content

Commit 0e131fd

Browse files
authored
Merge pull request #230 from msrd0/string-borrowmut
Add missing `BorrowMut` implementation for `ArrayString`
2 parents 0637cb7 + 9dd3f3c commit 0e131fd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: src/array_string.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::borrow::Borrow;
1+
use std::borrow::{Borrow, BorrowMut};
22
use std::cmp;
33
use std::convert::TryFrom;
44
use std::fmt;
@@ -481,6 +481,11 @@ impl<const CAP: usize> Borrow<str> for ArrayString<CAP>
481481
fn borrow(&self) -> &str { self }
482482
}
483483

484+
impl<const CAP: usize> BorrowMut<str> for ArrayString<CAP>
485+
{
486+
fn borrow_mut(&mut self) -> &mut str { self }
487+
}
488+
484489
impl<const CAP: usize> AsRef<str> for ArrayString<CAP>
485490
{
486491
fn as_ref(&self) -> &str { self }

0 commit comments

Comments
 (0)