string icon indicating copy to clipboard operation
string copied to clipboard

StableAsRef for &str

Open aitvann opened this issue 5 years ago • 0 comments

Hi! As of current status &str can't be used as buffer for String. StableAsRef implemented for str, but not implemented for &str due to implicit Sized bound in unsafe impl<'a, T> StableAsRef for &'a T where T: StableAsRef {}. Adding + ?Sized will allow to use &str as buffer for String and probably other types. I'am not sure that this won't allow to store invalid UTF-8 in String as in #9 . Is it an intentional limitation or just missing bound?

aitvann avatar Jun 26 '20 19:06 aitvann