Add #[inline] to AsRef<str>::as_ref for String and str.

This commit is contained in:
Jan Bujak 2015-05-10 14:06:41 +02:00
parent 0848d1c6a5
commit a168dbad15
2 changed files with 2 additions and 0 deletions

View File

@ -1052,6 +1052,7 @@ impl<T: fmt::Display + ?Sized> ToString for T {
#[stable(feature = "rust1", since = "1.0.0")]
impl AsRef<str> for String {
#[inline]
fn as_ref(&self) -> &str {
self
}

View File

@ -173,6 +173,7 @@ impl<T> AsMut<[T]> for [T] {
#[stable(feature = "rust1", since = "1.0.0")]
impl AsRef<str> for str {
#[inline]
fn as_ref(&self) -> &str {
self
}