Better interface for doc comment and attribute processing

This commit is contained in:
Lukas Wirth 2022-01-07 14:14:33 +01:00
parent 69dbfc7754
commit 08adce61a1
5 changed files with 66 additions and 64 deletions

View file

@ -14,6 +14,10 @@ impl ast::Comment {
CommentKind::from_text(self.text())
}
pub fn is_doc(&self) -> bool {
self.kind().doc.is_some()
}
pub fn is_inner(&self) -> bool {
self.kind().doc == Some(CommentPlacement::Inner)
}