From d24070bf8d58f40887b4b33f63c1c3d3df55c346 Mon Sep 17 00:00:00 2001 From: Matthias Krüger Date: Wed, 29 Aug 2018 12:30:54 +0200 Subject: liballoc: mark str.to_owned() and String::from(&str) as #[inline]. Fixes #53681 --- src/liballoc/str.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/liballoc/str.rs') diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index 2af89562d69..9916fa639e1 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -203,6 +203,7 @@ impl Borrow for String { #[stable(feature = "rust1", since = "1.0.0")] impl ToOwned for str { type Owned = String; + #[inline] fn to_owned(&self) -> String { unsafe { String::from_utf8_unchecked(self.as_bytes().to_owned()) } } -- cgit 1.4.1-3-g733a5