mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Add missing inlines
This commit is contained in:
parent
cd532e615a
commit
b97447b125
1 changed files with 3 additions and 0 deletions
|
@ -6,6 +6,7 @@ mod generated;
|
|||
pub use self::generated::SyntaxKind;
|
||||
|
||||
impl From<u16> for SyntaxKind {
|
||||
#[inline]
|
||||
fn from(d: u16) -> SyntaxKind {
|
||||
assert!(d <= (SyntaxKind::__LAST as u16));
|
||||
unsafe { std::mem::transmute::<u16, SyntaxKind>(d) }
|
||||
|
@ -13,12 +14,14 @@ impl From<u16> for SyntaxKind {
|
|||
}
|
||||
|
||||
impl From<SyntaxKind> 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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue