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 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/syntax/src/ast/node_ext.rs b/crates/syntax/src/ast/node_ext.rs index 1bc1ef8434..c3d6f50e6b 100644 --- a/crates/syntax/src/ast/node_ext.rs +++ b/crates/syntax/src/ast/node_ext.rs @@ -139,6 +139,17 @@ impl From<ast::AssocItem> for ast::Item { } } +impl From<ast::ExternItem> for ast::Item { + fn from(extern_item: ast::ExternItem) -> Self { + match extern_item { + ast::ExternItem::Static(it) => ast::Item::Static(it), + ast::ExternItem::Fn(it) => ast::Item::Fn(it), + ast::ExternItem::MacroCall(it) => ast::Item::MacroCall(it), + ast::ExternItem::TypeAlias(it) => ast::Item::TypeAlias(it), + } + } +} + #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum AttrKind { Inner, |