Preserve trailing statement semicolons when using fmt: skip (#8273)

This commit is contained in:
Micha Reiser
2023-10-30 09:07:14 +09:00
committed by GitHub
parent e799f90782
commit 2c84f911c4
5 changed files with 85 additions and 3 deletions

View File

@@ -473,7 +473,7 @@ pub enum SimpleTokenKind {
}
impl SimpleTokenKind {
const fn is_trivia(self) -> bool {
pub const fn is_trivia(self) -> bool {
matches!(
self,
SimpleTokenKind::Whitespace
@@ -482,6 +482,10 @@ impl SimpleTokenKind {
| SimpleTokenKind::Continuation
)
}
pub const fn is_comment(self) -> bool {
matches!(self, SimpleTokenKind::Comment)
}
}
/// Simple zero allocation tokenizer handling most tokens.