Add #[inline] to AsRef<str>::as_ref for String and str.
This commit is contained in:
parent
0848d1c6a5
commit
a168dbad15
@ -1052,6 +1052,7 @@ impl<T: fmt::Display + ?Sized> ToString for T {
|
|||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl AsRef<str> for String {
|
impl AsRef<str> for String {
|
||||||
|
#[inline]
|
||||||
fn as_ref(&self) -> &str {
|
fn as_ref(&self) -> &str {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
@ -173,6 +173,7 @@ impl<T> AsMut<[T]> for [T] {
|
|||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl AsRef<str> for str {
|
impl AsRef<str> for str {
|
||||||
|
#[inline]
|
||||||
fn as_ref(&self) -> &str {
|
fn as_ref(&self) -> &str {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user