Skip to content

Commit

Permalink
Add some #[inline] attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Jun 25, 2019
1 parent 7e08576 commit c877989
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libsyntax_pos/symbol.rs
Expand Up @@ -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.
Expand All @@ -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()
}
Expand Down Expand Up @@ -1184,6 +1186,7 @@ impl !Sync for LocalInternedString {}

impl std::ops::Deref for LocalInternedString {
type Target = str;
#[inline]
fn deref(&self) -> &str { self.string }
}

Expand Down

0 comments on commit c877989

Please sign in to comment.