1
Fork 0

Add some #[inline] attributes

This commit is contained in:
John Kåre Alsaker 2019-06-25 04:00:03 +02:00
parent 7e08576e42
commit c877989655

View file

@ -1131,6 +1131,7 @@ impl LocalInternedString {
}
}
#[inline]
pub fn get(&self) -> &str {
// This returns a valid string since we ensure that `self` outlives the interner
// by creating the interner on a thread which outlives threads which can access it.
@ -1144,6 +1145,7 @@ impl<U: ?Sized> std::convert::AsRef<U> for LocalInternedString
where
str: std::convert::AsRef<U>
{
#[inline]
fn as_ref(&self) -> &U {
self.string.as_ref()
}
@ -1184,6 +1186,7 @@ impl !Sync for LocalInternedString {}
impl std::ops::Deref for LocalInternedString {
type Target = str;
#[inline]
fn deref(&self) -> &str { self.string }
}