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

@ -772,3 +772,13 @@ impl ast::HasLoopBody for ast::ForExpr {
}
impl ast::HasAttrs for ast::AnyHasDocComments {}
impl From<ast::Adt> for ast::Item {
fn from(it: ast::Adt) -> Self {
match it {
ast::Adt::Enum(it) => ast::Item::Enum(it),
ast::Adt::Struct(it) => ast::Item::Struct(it),
ast::Adt::Union(it) => ast::Item::Union(it),
}
}
}