From 1f84c3b18fd5340dbc64bba71af85dec8198ee65 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 6 Mar 2020 15:56:25 +0100 Subject: make::use_item --- crates/ra_syntax/src/ast/make.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index f25b526b6..53d6fa562 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs @@ -46,6 +46,10 @@ pub fn use_tree_list(use_trees: impl IntoIterator) -> ast:: ast_from_text(&format!("use {{{}}};", use_trees)) } +pub fn use_item(use_tree: ast::UseTree) -> ast::UseItem { + ast_from_text(&format!("use {};", use_tree.syntax())) +} + pub fn record_field(name: ast::NameRef, expr: Option) -> ast::RecordField { return match expr { Some(expr) => from_text(&format!("{}: {}", name.syntax(), expr.syntax())), -- cgit v1.2.3