Skip to content

Commit 4173645

Browse files
bors[bot]matklad
andauthored
Merge #3493
3493: make::use_item r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 parents 995a928 + 1f84c3b commit 4173645

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/ra_syntax/src/ast/make.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ pub fn use_tree_list(use_trees: impl IntoIterator<Item = ast::UseTree>) -> ast::
4646
ast_from_text(&format!("use {{{}}};", use_trees))
4747
}
4848

49+
pub fn use_item(use_tree: ast::UseTree) -> ast::UseItem {
50+
ast_from_text(&format!("use {};", use_tree.syntax()))
51+
}
52+
4953
pub fn record_field(name: ast::NameRef, expr: Option<ast::Expr>) -> ast::RecordField {
5054
return match expr {
5155
Some(expr) => from_text(&format!("{}: {}", name.syntax(), expr.syntax())),

0 commit comments

Comments
 (0)