We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0e07c42 + d24070b commit 96cafc5Copy full SHA for 96cafc5
src/liballoc/str.rs
@@ -203,6 +203,7 @@ impl Borrow<str> for String {
203
#[stable(feature = "rust1", since = "1.0.0")]
204
impl ToOwned for str {
205
type Owned = String;
206
+ #[inline]
207
fn to_owned(&self) -> String {
208
unsafe { String::from_utf8_unchecked(self.as_bytes().to_owned()) }
209
}
src/liballoc/string.rs
@@ -2196,6 +2196,7 @@ impl AsRef<[u8]> for String {
2196
2197
2198
impl<'a> From<&'a str> for String {
2199
2200
fn from(s: &'a str) -> String {
2201
s.to_owned()
2202
0 commit comments