We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 995a928 + 1f84c3b commit 4173645Copy full SHA for 4173645
crates/ra_syntax/src/ast/make.rs
@@ -46,6 +46,10 @@ pub fn use_tree_list(use_trees: impl IntoIterator<Item = ast::UseTree>) -> ast::
46
ast_from_text(&format!("use {{{}}};", use_trees))
47
}
48
49
+pub fn use_item(use_tree: ast::UseTree) -> ast::UseItem {
50
+ ast_from_text(&format!("use {};", use_tree.syntax()))
51
+}
52
+
53
pub fn record_field(name: ast::NameRef, expr: Option<ast::Expr>) -> ast::RecordField {
54
return match expr {
55
Some(expr) => from_text(&format!("{}: {}", name.syntax(), expr.syntax())),
0 commit comments