string
string copied to clipboard
StableAsRef for &str
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?