Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions crates/oxc_ast/src/trivia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub struct Comment {
}

impl Comment {
#[inline]
pub fn new(end: u32, kind: CommentKind) -> Self {
Self { kind, end }
}
Expand All @@ -28,12 +29,14 @@ pub enum CommentKind {
}

impl CommentKind {
#[inline]
pub fn is_single_line(self) -> bool {
matches!(self, Self::SingleLine)
self == Self::SingleLine
}

#[inline]
pub fn is_multi_line(self) -> bool {
matches!(self, Self::MultiLine)
self == Self::MultiLine
}
}

Expand All @@ -54,6 +57,7 @@ pub struct TriviasImpl {
impl Deref for Trivias {
type Target = TriviasImpl;

#[inline]
fn deref(&self) -> &Self::Target {
self.0.as_ref()
}
Expand Down