From b97447b12546c8c87defca997ab0489a004b9bf8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 17 Jan 2021 16:50:03 +0300 Subject: Add missing inlines --- crates/parser/src/syntax_kind.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crates/parser') diff --git a/crates/parser/src/syntax_kind.rs b/crates/parser/src/syntax_kind.rs index 63204436c..9ea0e4f9b 100644 --- a/crates/parser/src/syntax_kind.rs +++ b/crates/parser/src/syntax_kind.rs @@ -6,6 +6,7 @@ mod generated; pub use self::generated::SyntaxKind; impl From for SyntaxKind { + #[inline] fn from(d: u16) -> SyntaxKind { assert!(d <= (SyntaxKind::__LAST as u16)); unsafe { std::mem::transmute::(d) } @@ -13,12 +14,14 @@ impl From for SyntaxKind { } impl From for u16 { + #[inline] fn from(k: SyntaxKind) -> u16 { k as u16 } } impl SyntaxKind { + #[inline] pub fn is_trivia(self) -> bool { matches!(self, SyntaxKind::WHITESPACE | SyntaxKind::COMMENT) } -- cgit v1.2.3