Skip to content

Commit

Permalink
Merge pull request #230 from msrd0/string-borrowmut
Browse files Browse the repository at this point in the history
Add missing `BorrowMut` implementation for `ArrayString`
  • Loading branch information
bluss committed Nov 12, 2022
2 parents 0637cb7 + 9dd3f3c commit 0e131fd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/array_string.rs
@@ -1,4 +1,4 @@
use std::borrow::Borrow;
use std::borrow::{Borrow, BorrowMut};
use std::cmp;
use std::convert::TryFrom;
use std::fmt;
Expand Down Expand Up @@ -481,6 +481,11 @@ impl<const CAP: usize> Borrow<str> for ArrayString<CAP>
fn borrow(&self) -> &str { self }
}

impl<const CAP: usize> BorrowMut<str> for ArrayString<CAP>
{
fn borrow_mut(&mut self) -> &mut str { self }
}

impl<const CAP: usize> AsRef<str> for ArrayString<CAP>
{
fn as_ref(&self) -> &str { self }
Expand Down

0 comments on commit 0e131fd

Please sign in to comment.