Merge pull request #230 from msrd0/string-borrowmut

Add missing `BorrowMut` implementation for `ArrayString`
This commit is contained in:
bluss
2022-11-12 10:04:16 +01:00
committed by GitHub
+6 -1
View File
@@ -1,4 +1,4 @@
use std::borrow::Borrow;
use std::borrow::{Borrow, BorrowMut};
use std::cmp;
use std::convert::TryFrom;
use std::fmt;
@@ -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 }