Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/ast/node_ext.rs')
| -rw-r--r-- | crates/syntax/src/ast/node_ext.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/syntax/src/ast/node_ext.rs b/crates/syntax/src/ast/node_ext.rs index dbde2a5351..705aa5edac 100644 --- a/crates/syntax/src/ast/node_ext.rs +++ b/crates/syntax/src/ast/node_ext.rs @@ -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), + } + } +} |