From a168dbad15e108fce02a996fc8f72803460b7a55 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Sun, 10 May 2015 14:06:41 +0200 Subject: [PATCH] Add #[inline] to AsRef::as_ref for String and str. --- src/libcollections/string.rs | 1 + src/libcore/convert.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 3c668f7fe9b..bb5345917e7 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -1052,6 +1052,7 @@ impl ToString for T { #[stable(feature = "rust1", since = "1.0.0")] impl AsRef for String { + #[inline] fn as_ref(&self) -> &str { self } diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs index d3de77a9241..da6ac6bd752 100644 --- a/src/libcore/convert.rs +++ b/src/libcore/convert.rs @@ -173,6 +173,7 @@ impl AsMut<[T]> for [T] { #[stable(feature = "rust1", since = "1.0.0")] impl AsRef for str { + #[inline] fn as_ref(&self) -> &str { self }